Skip to content
fn

random_bernoulli_storage

→Storage
int random_bernoulli_storage(const int & shape, double p, Dtype dt, Device device, Generator & gen)

Generate Bernoulli samples with success probability p.

Parameters

shapeconst Shape&
Output shape.
pdouble
Success probability for value 1; failure value is 0.
dtDtype
Output dtype; F32 or F64 only.
deviceDevice
Target device.
Random-number generator.

Returns

Storage

New storage of shape shape with Bernoulli samples.