Block#

class sionna.phy.block.Block(*args: Any, precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs: Any)[source]#

Bases: sionna.phy.object.Object

Abstract class for Sionna PHY processing blocks.

All Sionna PHY processing blocks inherit from this class. It provides automatic input casting to the block’s precision, lazy building based on input shapes, and compatibility with torch.compile.

Parameters:
  • precision (Literal['single', 'double'] | None) – Precision used for internal calculations and outputs. None (default) | "single" | "double". If None, precision is used. Defaults to None.

  • device (str | None) – Device for computation (e.g., 'cpu', 'cuda:0'). If None, device is used. Defaults to None.

  • args (Any)

  • kwargs (Any)

Notes

Input conversion and lazy building happen on every call, so a block behaves the same in eager mode and under torch.compile.

Compiling a block with a traceable build() before its first call costs one additional trace, because built changes during that call. Calling the block once eagerly beforehand avoids the additional trace.

With fullgraph=True, build() must itself be traceable. Call the block once eagerly first if build() creates torch.nn.Parameter instances or uses unsupported Python or NumPy operations. Otherwise, compilation raises torch._dynamo.exc.Unsupported. Without fullgraph=True, unsupported build operations cause graph breaks instead.

Methods

call(*args: Any, **kwargs: Any) → Any[source]#

Process inputs. Must be implemented by subclasses.

Parameters:
forward(*args: Any, **kwargs: Any) → Any[source]#

Delegates to call().

Parameters:

Attributes

property built: bool#

Indicates if the block’s build function was called.