Skip to main content

sum_native_tensor

Function sum_native_tensor 

Source
pub fn sum_native_tensor(tensor: &Tensor) -> Result<BackendScalar, BridgeError>
Expand description

Sum all elements of a native tensor, returning a dynamic scalar.

ยงErrors

Returns a BridgeError when the backend reduction fails, when the reduced result cannot read back its host slice, or when the scalar cannot be wrapped as a BackendScalar.