Reverse subtraction: .
Useful when b is a Python scalar that cannot left-bind the -
operator against a tensor in a particular calling convention.
Parameters
Returns
TensorElement-wise difference of the broadcast shape of a and b.
Notes
Mathematical definition:
Equivalent to subtract with the operands reversed (and alpha
re-attached to the new second argument). Gradient w.r.t. a is
; w.r.t. b is .
Examples
>>> import lucid
>>> a = lucid.tensor([1.0, 2.0])
>>> lucid.rsub(a, 10.0)
Tensor([9., 8.])