sum

Function sum 

Source
pub fn sum<Run: CubeRuntime>(
    tensor: CubeTensor<Run>,
    strategy: SumStrategy,
) -> Result<CubeTensor<Run>, ReduceError>
Expand description

Specialize reduce function to compute the sum of all elements of the input tensor and return the value into a single-element tensor of shape 1 x 1 x 1 x ... with the same rank as input.

This is expected to be faster for larger tensors than calling reduce with the Sum instruction.

Return an error if the client doesn’t support atomic add for the type E.