Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed documentation for Zero-Shot Prediction #316

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

apkuhar
Copy link

@apkuhar apkuhar commented Jan 27, 2023

norm must be done with dim=1 not dim=-1

norm must be done with dim=1 not dim=-1
@shinian-023
Copy link

dim=1 and dim=-1 are the same

@apkuhar
Copy link
Author

apkuhar commented Feb 27, 2023

@GentelmanTenyeaers
Not strictly, it depends on the number of dimensions of the input tensor.
The problem is if someone blindly copies the examples and modified it's for his own use, no realizing the -1 is not the intended dimension.

Plus the code internally actually uses dim=1

image_features = image_features / image_features.norm(dim=1, keepdim=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants