I am trying to get infinity norm for a tensor and variable but while one is always giving a value of 1 other throws up an error, Any suggestions as to how could we go about implementing it.
import torch
from torch.autograd import Variable
tor = torch.rand([3,3])
var = Variable(torch.rand([3,3]))
c1 = 'inf'
c = float(c1)
tor_norm = tor.norm(c)
tor_norm
1.0
>>> var_norm = var.norm(c)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/torch3/lib/python3.5/site-packages/torch/autograd/variable.py", line 396, in norm
    return super(Variable, self).norm(p)
RuntimeError: value cannot be converted to type float without overflow: inf