Created
March 6, 2021 14:25
-
-
Save alkalait/e4db42c6e428ba4a0e8a5ded1440f545 to your computer and use it in GitHub Desktop.
Yet another pretty shape print
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 | |
import numpy | |
def shape(name : str) -> None: | |
''' | |
yaarr = torch.ones(25, 1, 1, 5, 5) # or np.ones | |
shape('yaarr') | |
>> yaarr : (25, 1, 1, 5, 5) | |
''' | |
val = eval(name) | |
print(f'{name} : {tuple(val.shape)}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment