Skip to content
fn

sub_inplace_op

→TensorImplPtr
int sub_inplace_op(const int & a, const int & b)

In-place elementwise subtraction: writes a−ba - b back into a.

Math

ai←ai−bia_i \leftarrow a_i - b_i

See Also

sub_op — out-of-place counterpart.

Parameters

aTensorImplPtr
Left operand and in-place target. Must be non-null and must not share storage with a view.
bTensorImplPtr
Right operand. Must be non-null and broadcastable into a->shape().

Returns

TensorImplPtr

The same pointer as a, now holding the difference storage.

Raises

ShapeMismatch
If the broadcast output would change a's shape.
RuntimeError
If a shares storage with a view.