Trait SumFromStorage
pub trait SumFromStorage: Sized {
// Required method
fn sum_from_storage(storage: &Storage) -> Self;
}Expand description
Types that can be computed as the result of a reduction over Storage.
This lets callers write let s: T = tensor.sum(); without matching on storage.
Required Methods§
fn sum_from_storage(storage: &Storage) -> Self
fn sum_from_storage(storage: &Storage) -> Self
Compute the sum of all elements in the storage.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.