Debug print in vision tower forward
This commit is contained in:
parent
e4d9a6f8ff
commit
ffb3c9e729
1 changed files with 7 additions and 0 deletions
|
|
@ -696,8 +696,15 @@ class Qwen3VL32BVision(nn.Module):
|
|||
deepstack_features = []
|
||||
for layer_num, block in enumerate(self.blocks):
|
||||
x = block(x, cu_seqlens=cu_seqlens, position_embeddings=position_embeddings)
|
||||
if layer_num == 0:
|
||||
print(f"[vision] after block 0: x.shape={tuple(x.shape)}, grid_thw={grid_thw.tolist()}")
|
||||
if layer_num in self.deepstack_visual_indexes:
|
||||
# x should be [N_patches, C]; if not, re-flatten.
|
||||
if x.ndim != 2:
|
||||
x = x.reshape(-1, x.shape[-1])
|
||||
deepstack_features.append(self.deepstack_merger_list[self.deepstack_visual_indexes.index(layer_num)](self._merge_tokens(x, grid_thw)))
|
||||
if x.ndim != 2:
|
||||
x = x.reshape(-1, x.shape[-1])
|
||||
return self.merger(self._merge_tokens(x, grid_thw)), deepstack_features
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue