Rate this Page

torch.Tensor.bernoulli#

Tensor.bernoulli(*,generator=None)Tensor#

Returns a result tensor where eachresult[i]\texttt{result[i]} is independentlysampled fromBernoulli(self[i])\text{Bernoulli}(\texttt{self[i]}).self must havefloating pointdtype, and the result will have the samedtype.

Seetorch.bernoulli()