Compose

class nvidia_resiliency_ext.inprocess.Compose(*instances)[source]

Performs functional composition (chaining) of multiple callable class instances.

Output of the previous callable is passed as input to the next callable, and the output of the last callable is returned as the final output of a Compose instance.

Constructed Compose object is an instance of the lowest common ancestor in method resolution order of all input callable class instances.

Example:

composed = Compose(a, b, c)
ret = composed(arg)  # is equivalent to ret = a(b(c(arg)))
Parameters:

instances (Callable[[T], T])