Operator

Operator#

class torchsim.Operator(emit, duration_s=0.0)[source]#

Bases: object

One module of a sequence: what it plays, and how long it lasts.

Parameters:
  • emit (callable) – Given the absolute time the module starts, in seconds, the events it plays.

  • duration_s (float or torch.Tensor, optional) – What the module holds the timeline for. Zero for a module that plays instantaneously and leaves the next one to start where it did.

__matmul__(other)[source]#

a @ b: the two played back to back, as one operator.

The same thing module() does for a list, spelled for the common case of joining two – a sample and the gradient after it, a pulse and its crusher – so a handler reads as the composition it is.