MultiChannelFunction¶
- class madspace.MultiChannelFunction(self: madspace._madspace_py.MultiChannelFunction, functions: collections.abc.Sequence[madspace._madspace_py.FunctionGenerator], return_batch_sizes: bool = False)¶
Bases:
FunctionGeneratorApplies one of several channel functions to each slice of the batch.
The FunctionGenerator counterpart of MultiChannelMapping. The batch is partitioned by the per-channel counts in the
batch_sizesargument. Each slice is passed through its channel function, and the results are concatenated. All channel functions must share the same argument and return layout, which this class then exposes (Sec. 2.1.1 of [1]).batchis the leading batch dimension.Arguments
the arguments of the channel functions, plus
batch_sizes– the number of batch entries routed to each channel.
Returns
the returns of the channel functions, plus
batch_sizes– echoed back, only whenreturn_batch_sizesis true.
References
[1] T. Heimel, O. Mattelaer, R. Winterhalder, “MadSpace”, https://arxiv.org/abs/2602.06895 (Sec. 2.1.1)
- Parameters:
functions – The per-channel functions.
return_batch_sizes – If true, the
batch_sizesargument is also returned.