Module Shape

Shape representation for tensor dimensions in SPFlow modules.

ModuleShape

Represents tensor shape (excluding batch dimension) for modules.

class spflow.modules.module_shape.ModuleShape(features, channels, repetitions)[source]

Bases: object

Represents tensor shape (excluding batch dimension).

Shapes in SPFlow modules are 3-dimensional: (features, channels, repetitions). This dataclass provides named access and supports iteration and indexing.

features

Number of features (random variables/scope size).

channels

Number of parallel channels/distributions.

repetitions

Number of independent repetitions.

Examples

>>> shape = ModuleShape(4, 8, 2)
>>> shape.features
4
>>> shape[1]  # channels
8
>>> tuple(shape)
(4, 8, 2)
channels: int
features: int
repetitions: int