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)

Methods

build(*arg_shapes, **kwarg_shapes)[source]#

Initialize the block based on the inputs’ shapes.

Subclasses can override this method to create tensors or sub-blocks whose sizes depend on the input shapes.

Parameters:
  • *arg_shapes – Shapes of the positional arguments. Can be tuples (for tensors) or nested structures thereof (for lists/dicts of tensors).

  • **kwarg_shapes – Shapes of the keyword arguments. Can be tuples (for tensors) or nested structures thereof (for lists/dicts of tensors).

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.