BinarySource#
- class sionna.phy.mapping.BinarySource(precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs: Any)[source]#
Bases:
sionna.phy.block.BlockGenerates a random binary tensor.
- Parameters:
- Inputs:
shape – 1D tensor/array/list, int. Desired shape of the output tensor.
- Outputs:
bits –
shape, torch.float. Tensor filled with random binary values.
Examples
import torch from sionna.phy.mapping import BinarySource source = BinarySource() bits = source([10, 100]) print(bits.shape) # torch.Size([10, 100])