tensor.reduce_sum
tensor.reduce_sum
Reduces a tensor by summing its elements along a specified axis.
Args
self
(@Tensor<T>
) - The input tensor.axes
(Option<Span<i32>>
) - Optional input list of integers, along which to reduce. The default is to reduce over all the dimensions of the input tensor if 'noop_with_empty_axes' is false, else act as an Identity op when 'noop_with_empty_axes' is true.keepdims
(Option<bool>
) - Keep the reduced dimension or not, default 1 means keep reduced dimension.noop_with_empty_axes
(Option<bool>
) - Defines behavior if 'axes' is empty. Default behavior with 'false' is to reduce all axes. When axes is empty and this attribute is set to true, input tensor will not be reduced,and the output tensor would be equivalent to input tensor.
Returns
Reduced output tensor.
Examples
Last updated