boundlab.expr.MakeTuple#

class boundlab.expr.MakeTuple[source]#

Bases: TupleExpr

Expression representing the construction of a tuple from multiple sub-expressions.

This is used to combine multiple expressions into a single TupleExpr, such as the outputs of a multi-output operation. Like GetTupleItem, this is an implementation detail for handling multi-output operations and is not intended for direct use by users.

children#

A tuple of sub-expressions that are combined into this TupleExpr.

Methods

__init__

backward

Perform backward-mode bound propagation through this expression.

to_string

Convert this expression to a string for debugging purposes.

with_children

Return a new TupleExpr with the same flags but new children.

__init__(*children)[source]#
property shape: tuple[torch.Size, ...]#
property children: tuple[Expr, ...]#

Children expressions that contribute to this TupleExpr. This is used for topological sorting and weight propagation.

backward(*weights, direction='==')[source]#

Perform backward-mode bound propagation through this expression.

with_children(*new_children)[source]#

Return a new TupleExpr with the same flags but new children. This is used for expression rewriting during bound propagation.

to_string(*children_str, indent=0)#

Convert this expression to a string for debugging purposes. The children_str arguments are the string representations of the children expressions, in the same order as self.children.