Skip to content

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.

self.num_patches = int(num_patches)

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