rand#

sionna.phy.utils.rand(size: Sequence[int], *, dtype: torch.dtype | None = None, device: str | torch.device | None = None, generator: torch._C.Generator | None = None) torch.Tensor[source]#

Generate random uniform tensor [0, 1), compile-aware.

In eager mode, uses the provided generator for reproducibility. In compiled mode, uses global RNG state for graph fusion.

Parameters:
  • size (Sequence[int]) – Shape of the output tensor.

  • dtype (torch.dtype | None) – Data type of the output tensor.

  • device (str | torch.device | None) – Device for the output tensor.

  • generator (torch._C.Generator | None) – Random number generator (used only in eager mode).

Outputs:

samples – Tensor with random uniform values.