Skip to main content

RandomSource

Trait RandomSource 

Source
pub trait RandomSource<T> {
    // Required method
    fn next(&mut self) -> T;
}
Expand description

Trait for sources of random data for tensors, for use with Tensor::rand.

Required Methods§

Source

fn next(&mut self) -> T

Generate the next random value.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§