fn
random_bernoulli_storage
→Storageint 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.
pdoubleSuccess probability for value
1; failure value is 0.dtDtypeOutput dtype;
F32 or F64 only.deviceDeviceTarget device.
genGenerator&Random-number generator.
Returns
StorageNew storage of shape shape with Bernoulli samples.