The C++ equivalent of numpy.linalg.norm?

Dear dambo,

I had the same concerns as you, and designed a cpp function, linalg_norm [1] using the LibTorch that performs the functions of the numpy.linalg.norm.
Actually, the LibTorch also provides Function torch::linalg::norm() [2], but I cannot use it because I don’t know the required data types for the function.

I hope this reply is helpful to you.

Best regards,
Vujadeyoon

[1] How to convert numpy.linalg.norm to LibTorch codes

[2] Function torch::linalg::norm(const Tensor&, const optional<Scalar>&, OptionalIntArrayRef, bool, optional<ScalarType>) — PyTorch master documentation