Skip to content
fn

random_normal_storage

→Storage
int random_normal_storage(const int & shape, double mean, double std, Dtype dt, Device device, Generator & gen)

Generate normally distributed samples using the Box-Muller transform.

Parameters

shapeconst Shape&
Output shape.
meandouble
Mean of the resulting normal distribution.
stddouble
Standard deviation (non-negative).
dtDtype
Output dtype; F32 or F64 only.
deviceDevice
Target device.
Random-number generator.

Returns

Storage

New storage of shape shape with i.i.d. \mathcal{N}(\text{mean}, \text{std}^2) samples.