mirror of
https://github.com/openai/CLIP.git
synced 2026-11-05 01:37:26 +00:00
[GH-ISSUE #420] Dimension Discrepancy in VisionTransformer? #360
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openai/CLIP#360
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Shiran-Yuan on GitHub (Jan 18, 2024).
Original GitHub issue: https://github.com/openai/CLIP/issues/420
In line 227 of clip/model.py there is:
x = torch.cat([self.class_embedding.to(x.dtype) + torch.zeros(x.shape[0], 1, x.shape[-1], dtype=x.dtype, device=x.device), x], dim=1) # shape = [*, grid ** 2 + 1, width].But this seems impossible, because self.class_embedding is a parameter vector, while torch.zeros(x.shape[0], 1, x.shape[-1]) is a order-3 tensor...
Am I missing something here?