oneflow.Tensor.bernoulli

Tensor.bernoulli()

See oneflow.bernoulli()

For example:

>>> import oneflow as flow
>>> x = flow.Tensor([1, 1, 1])
>>> x.bernoulli()
tensor([1., 1., 1.], dtype=oneflow.float32)
>>> x.bernoulli(p=0.0)
tensor([0., 0., 0.], dtype=oneflow.float32)