RandomScalar

Trait RandomScalar 

Source
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§

Source

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.

Implementations on Foreign Types§

Source§

impl RandomScalar for f64

Source§

fn random_value<R: Rng>(rng: &mut R) -> Self

Source§

impl RandomScalar for Complex64

Source§

fn random_value<R: Rng>(rng: &mut R) -> Self

Implementors§