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.
Tensor.bernoulli(*, generator=None) → Tensor Returns a result tensor where each is independently sampled from . self must have floating point dtype, and the result will have the same dtype.
© 2025, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.9/generated/torch.Tensor.bernoulli.html