Skip to content

opto.trace.broadcast

recursive_conversion

recursive_conversion(true_func, false_func)

Recursively apply true_func to the nodes and false_func to the rest of the objects in a container of nodes. Container of nodes are tuple, list, dict, set, and NodeContainer.

Args: true_func (callable): the function to be applied to the nodes. false_func (callable): the function to be applied to the rest of the objects.

apply_op

apply_op(op, output, *args, **kwargs)

A broadcasting operation that applies an op to container of Nodes.

Args: op (callable): the operator to be applied. output (Any): the container to be updated. args (Any): the positional inputs of the operator. *kwargs (Any): the keyword inputs of the operator.