nvidia.dali.experimental.dynamic.coin_flip#
- nvidia.dali.experimental.dynamic.coin_flip(shape_like=None, /, *, batch_size=None, device=None, dtype=None, probability=None, seed=None, shape=None, rng=None)#
Warning
This operator is now deprecated. Use
random.coin_flip()instead.Generates random boolean values following a bernoulli distribution.
The probability of generating a value 1 (true) is determined by the
probabilityargument.The shape of the generated data can be either specified explicitly with a
shapeargument, or chosen to match the shape of the input, if provided. If none are present, a single value per sample is generated.- Supported backends
‘cpu’
‘gpu’
- Parameters:
shape_like¶ (Tensor/Batch, optional) – Shape of this input will be used to infer the shape of the output, if provided.
- Keyword Arguments:
dtype¶ (
nvidia.dali.types.DALIDataType, optional) –Output data type.
Note
The generated numbers are converted to the output data type, rounding and clamping if necessary.
probability¶ (float or Tensor/Batch of float, optional, default = 0.5) – Probability of value 1.
shape¶ (int or list of int or Tensor/Batch of int, optional) – Shape of the output data.
rng¶ (RNG, optional) – A random number generator instance. Can be obtained by calling
nvidia.dali.experimental.dynamic.random.RNG(seed)(). If not provided, the default RNG is used.