boundlab.diff.ops.diff_pair#
- boundlab.diff.ops.diff_pair(x, y)[source]#
Mark
xandyas the two branches of one differential value.Exported as
boundlab::DiffPair; the interpreter lifts that node into aDiffExpr2. Eagerly it is a no-op returningx, so a paired model still runs as network 1.- Parameters:
Examples
>>> import torch >>> from boundlab.diff.ops import diff_pair >>> diff_pair(torch.zeros(4), torch.ones(4)).shape torch.Size([4])