fn
bernoulli_mask_storage_shape
→Storageint bernoulli_mask_storage_shape(double keep_prob, const int & shape, Dtype dt, Device device, Generator & gen)Generate a Bernoulli dropout mask matching an explicit N-D shape.
Same semantics as bernoulli_mask_storage but the returned
storage carries shape directly instead of a flat 1-D shape.
Parameters
keep_probdoubleProbability of keeping each element.
shapeconst Shape&Target shape.
dtDtypeOutput dtype;
F32 or F64 only.deviceDeviceTarget device.
genGenerator&Random-number generator.
Returns
StorageNew storage of shape shape holding the mask.