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

For Python 3 and recent PyTorch #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

gngdb
Copy link

@gngdb gngdb commented Sep 3, 2018

Tested to work with Python 3 and the version of PyTorch currently installed by conda (0.4.1). Also, added .gitignore to ignore files generated by Python that shouldn't be committed and changed the tabs to 4 spaces because PEP8.


def flatten(self,matrix): # takes NxCxHxW input and outputs NxHWC
return matrix.view((self.batch_size*self.num_patches,-1))
Copy link

@ShirAmir ShirAmir Feb 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be:

return matrix.reshape((self.batch_size*self.num_patches,-1))

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it hitting an error about non-contiguous tensors?

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