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

Question for the code x = x[torch.arange(x.shape[0]), tokenized_prompts.argmax(dim=-1)] @ self.text_projection #66

Open
OxInsky opened this issue Sep 8, 2023 · 0 comments

Comments

@OxInsky
Copy link

OxInsky commented Sep 8, 2023

Hello, thanks for your work, it's interesting! but iam trouble with follow code
x = x[torch.arange(x.shape[0]), tokenized_prompts.argmax(dim=-1)] @ self.text_projection in CoOp.py Class TextEncode->Function forward()

I am curious about the self.text_projection. Is it the clip's textencode's output? and how x it work to select the max value in the matrix?
Can you explain it more? thanks a lot!

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

No branches or pull requests

1 participant