torch.Tensor.bernoulli
Tensor.bernoulli(*, generator=None) -> Tensor
Returns a result tensor where each \texttt{result[i]} is
   independently sampled from \text{Bernoulli}(\texttt{self[i]}).
   "self" must have floating point "dtype", and the result will have
   the same "dtype".
See "torch.bernoulli()"