ClikaRT::ops::renorm
function
renorm()
Tensor renorm(
Tensor x,
Scalar p,
int64_t dim,
Scalar maxnorm,
std::optional<double> eps = std::nullopt
)
Caps each sub-tensor's p-norm along dim at maxnorm.
Every slice along dim whose p-norm exceeds maxnorm is rescaled to exactly maxnorm; slices already within the bound pass through unchanged.
Parameters
x: the input tensor; float dtype.p: the norm degree, an int or floatScalar, kind-preserved.dim: the axis whose slices are re-normalized.maxnorm: the norm ceiling: int or floatScalar.eps: divide-by-zero floor;std::nulloptselects 1e-7.
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 3699