tensor.reduce_l2
tensor.reduce_l2
Computes the L2 norm of the input tensor's elements along the provided axes.
Args
self
(@Tensor<T>
) - The input tensor.axis
(usize
) - The dimension to reduce.keepdims
(bool
) - If true, retains reduced dimensions with length 1.
Panics
Panics if axis is not in the range of the input tensor's dimensions.
Returns
A new Tensor<T>
instance with the specified axis reduced by summing its elements.
Examples
Last updated