[GH-ISSUE #387] I'm confused that logits_per_text is just transpose of logits_per_text. #332

Open
opened 2026-10-31 21:13:58 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @nietzsche9088 on GitHub (Sep 15, 2023).
Original GitHub issue: https://github.com/openai/CLIP/issues/387

Thanks for your contribution!

When I'm reviewing the source code of CLIP, I found out that the output of "model(img,text)" is a list of two same-value tensors. Back to /clip/model.py, it shows model.eval() prints logits_per_image, and logits_per_text, and the latter one is just a transpose of the former one. Besides, the logits_per_image is already the multiplication of image features and text features.

I'd appreciate it if someone could answer my confusion.

Originally created by @nietzsche9088 on GitHub (Sep 15, 2023). Original GitHub issue: https://github.com/openai/CLIP/issues/387 Thanks for your contribution! When I'm reviewing the source code of CLIP, I found out that the output of "model(img,text)" is a list of two same-value tensors. Back to /clip/model.py, it shows model.eval() prints logits_per_image, and logits_per_text, and the latter one is just a transpose of the former one. Besides, the logits_per_image is already the multiplication of image features and text features. I'd appreciate it if someone could answer my confusion.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openai/CLIP#332
No description provided.