Cytnx icon indicating copy to clipboard operation
Cytnx copied to clipboard

Return type of .Norm()

Open pcchen opened this issue 3 months ago • 1 comments

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.

pcchen avatar Sep 17 '25 06:09 pcchen

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.

manuschneider avatar Nov 02 '25 04:11 manuschneider