You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
torch.norm only accepts p, dim, giving only dim results in error
In [3]: torch.autograd.Variable(torch.randn(4,8)).norm(dim=1)
Out[3]:
Variable containing:
2.1210
3.0991
2.4054
2.1048
[torch.FloatTensor of size 4x1]
In [4]: torch.randn(4,8).norm(dim=1)
TypeError: norm received an invalid combination of arguments - got (dim=int, ), but expected one of:
* no arguments
* (float p)
didn't match because some of the keywords were incorrect: dim
* (float p, int dim)
In [8]: torch.randn(4,8).norm(p=2, dim=1)
Out[8]:
1.9636
2.1119
2.8933
4.0552
[torch.FloatTensor of size 4x1]