# torch.Tensor.bernoulli¶

Tensor.bernoulli(*, generator=None)

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.