ClikaRT::ops::normalize
function
normalize()
Tensor normalize(
Tensor x,
Scalar p = 2.0,
int64_t dim = 1,
std::optional<double> eps = std::nullopt
)
L_p-normalizes x along dim: each slice is scaled to unit p-norm.
Parameters
x: the input tensor; float dtype.p: the norm degree, an int or floatScalar, kind-preserved; default 2.dim: the axis to normalize along; default 1.eps: divide-by-zero floor;std::nulloptselects 1e-12.
Returns: a new tensor, same shape and dtype as x.
Throws
ClikaRT::Error: (INVALID_ARGUMENT) whendimis out of range.
Declared in ClikaRT/compute/ops.h, line 3678