In-place elementwise addition: writes back into a.
Equivalent to a = add_op(a, b) but reuses a's storage and
bumps its version counter. b may broadcast up to a's shape
but the broadcast output shape must equal a->shape().
Math
See Also
add_op — out-of-place counterpart.
Parameters
aTensorImplPtrLeft operand and in-place target. Must be non-null and must not share storage with a view.
bTensorImplPtrRight operand. Must be non-null and have a shape broadcastable to
a->shape() such that the broadcast result equals a->shape().Returns
TensorImplPtrThe same pointer as a, now holding the summed storage.
Raises
ShapeMismatchIf the broadcast output of
add_op(a, b) does not equal a->shape() (i.e. a would have to grow to fit the result).RuntimeErrorIf
a shares storage with a view (call .clone() first).