uniform#

sionna.phy.utils.uniform(size: Sequence[int], *, low: float = 0.0, high: float = 1.0, dtype: torch.dtype | None = None, device: str | torch.device | None = None, generator: torch._C.Generator | None = None) torch.Tensor[source]#

Generate random uniform tensor in [low, high), 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.

  • low (float) – Lower bound (inclusive). Defaults to 0.0.

  • high (float) – Upper bound (exclusive). Defaults to 1.0.

  • 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 in [low, high).