Cytnx
Cytnx copied to clipboard
Return type of .Norm()
Now
Tensor.Norm()returns a rank-0 Tensor.UniTensor.Norm()returns a rank-0 UniTensor. Does it make more sense to return a number?
numpy.linalg.norm retuns float, unless you use axis argument to compute vector norms. But I don't think we need to support axis argument.
It would make sense to me to return double instead of rank-0 tensors. Was this maybe intended to allow for different data types and not return the same precision for every type? Anyways, I would suggest to change it. But it would break existing code.