On this page
torch.Tensor.bernoulli
Tensor.bernoulli(*, generator=None) → Tensor-
Returns a result tensor where each is independently sampled from .
selfmust have floating pointdtype, and the result will have the samedtype.
© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.Tensor.bernoulli.html