autodiff.reverse.Node.__sub__

Node.__sub__(other)

Returns the difference between self and other.

Parameters
selfNode
otherint, float, Node
Returns
outNode

Examples

Node and scalar:

>>> ad.Node(42) - 5
Node(37)

Two nodes:

>>> ad.Node(42) - ad.Node(1)
Node(41)
>>> ad.Node(42) - ad.Node.constant(2)
Node(40)