Skip to content
fn

maximum_inplace_op

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

In-place elementwise maximum: writes max⁡(a,b)\max(a, b) back into a.

Math

ai←max⁡(ai,bi)a_i \leftarrow \max(a_i, b_i)

See Also

maximum_op — out-of-place counterpart. minimum_inplace_op — elementwise minimum sibling.

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 elementwise maxima.

Raises

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