Sum reduction operation Computes the sum of tensor elements along specified axes
Input tensor storage type
Axes to reduce along (undefined means reduce all)
Whether to keep reduced dimensions as size 1
// Sum along axis 1, remove dimensiontype Input = TensorStorage<Float32, [2, 3, 4], [12, 4, 1], DefaultLayoutFlags>;type Result = SumOp<Input, [1], false>; // Shape: [2, 4] Copy
// Sum along axis 1, remove dimensiontype Input = TensorStorage<Float32, [2, 3, 4], [12, 4, 1], DefaultLayoutFlags>;type Result = SumOp<Input, [1], false>; // Shape: [2, 4]
// Sum all elements to scalartype Scalar = SumOp<Input, undefined, false>; // Shape: [] Copy
// Sum all elements to scalartype Scalar = SumOp<Input, undefined, false>; // Shape: []
Sum reduction operation Computes the sum of tensor elements along specified axes