Created
August 10, 2023 15:09
-
-
Save kimishpatel/b241207b03e7d9caeb3e27a064bd2004 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
self = torch.rand((10, 1)) | |
print(self.stride()) | |
order =[i[0] for i in sorted( | |
enumerate(self.stride()), key=lambda x: x[1], reverse=True | |
)] | |
print(order) | |
self_permuted = self.permute((1, 0)) | |
print(self_permuted.stride()) | |
order =[i[0] for i in sorted( | |
enumerate(self_permuted.stride()), key=lambda x: x[1], reverse=True | |
)] | |
print(order) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment