To normalise, in python I simply do:
F.normalize(x, p=2, dim=1)
I was wondering what is the libtorch c++ equivalent of this.
To normalise, in python I simply do:
F.normalize(x, p=2, dim=1)
I was wondering what is the libtorch c++ equivalent of this.
This should work:
namespace F = torch::nn::functional;
F::normalize(input, F::NormalizeFuncOptions().p(1).dim(-1));