Skip to content
fn

random_uniform_storage

→Storage
int random_uniform_storage(const int & shape, double lo, double hi, Dtype dt, Device device, Generator & gen)

Generate uniform random samples in the half-open interval [lo, hi).

Samples are produced on the CPU using gen and transferred to device to make the stream deterministic and reproducible.

Parameters

shapeconst Shape&
Output shape.
lo, hidouble
Half-open interval bounds.
dtDtype
Output dtype; F32 or F64 only.
deviceDevice
Target device.
Random-number generator.

Returns

Storage

New storage of shape shape with uniform samples.