boundlab.expr.Add#

boundlab.expr.Add(*children)[source]#

Construct an affine sum with unit coefficients.

This is a convenience alias for creating:

\[\sum_i x_i\]

where each input expression \(x_i\) receives an identity scalar coefficient 1.0.

Parameters:

*children (Expr) – Input expressions with matching shapes.

Returns:

An AffineSum representing the pointwise sum of children.

Return type:

AffineSum

Examples

>>> import torch
>>> import boundlab.expr as expr
>>> a = expr.ConstVal(torch.tensor([1.0, 2.0]))
>>> b = expr.LpEpsilon([2])
>>> s = expr.Add(a, b)
>>> s.shape
torch.Size([2])