Struct numeric::random::RandomState [] [src]

pub struct RandomState {
    // some fields omitted
}

Methods

impl RandomState
[src]

fn new(seed: usize) -> RandomState

Creates a new RandomState object with the given seed. The object needs to be captured as mutable in order to draw samples from it (since its internal state changes).

fn uniform<T>(&mut self, low: T, high: T, shape: &[usize]) -> Tensor<T> where T: Numeric + SampleRange

Generates a tensor by independently drawing samples from a uniform distribution in the range [low, high). This is appropriate for integer types as well.

fn normal<T>(&mut self, shape: &[usize]) -> Tensor<T> where T: Numeric + SampleRange + Float

Generates a tensor by independently drawing samples from a standard normal.