pub trait RandomScalar: TensorElement {
// Required method
fn random_value<R: Rng>(rng: &mut R) -> Self;
}Expand description
Trait for scalar types that can generate random values from a standard normal distribution.
This enables the generic TensorDynLen::random constructor.
Required Methods§
Sourcefn random_value<R: Rng>(rng: &mut R) -> Self
fn random_value<R: Rng>(rng: &mut R) -> Self
Generate a random value from the standard normal distribution.
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.