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

permutation order #14

Open
philipsgithub opened this issue Jun 9, 2023 · 1 comment
Open

permutation order #14

philipsgithub opened this issue Jun 9, 2023 · 1 comment

Comments

@philipsgithub
Copy link

philipsgithub commented Jun 9, 2023

desc = x.permute(0, 2, 3, 1).flatten(start_dim=-2, end_dim=-1).unsqueeze(dim=1) # Bx1xtx(dxh)

I am a bit confused. According to my understanding it should be x.permute(0, 2, 1, 3). same goes for line 239.

do I miss something?

PS:

bin_x = x.permute(0, 2, 3, 1).flatten(start_dim=-2, end_dim=-1) # Bx(t-1)x(dxh)

@ShirAmir
Copy link
Owner

As mentioned in the documentation of _extract_features, the outputted features are of shape Bxhxtxd. Hence, in the line you mentioned x.permute(0, 2, 3, 1) reshapes to Bxtxdxh; .flatten(start_dim=-2, end_dim=-1) reshapes to Bxtx(dxh) and .unsqueeze(dim=1) reshapes to Bx1xtx(dxh) as needed.

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

2 participants