Skip to content
fn

minimum_op

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

Python wrappers

Public Python APIs implemented by this engine symbol.

Compute the elementwise minimum y=min⁡(a,b)y = \min(a, b) with broadcasting and autograd support.

Parameters

aTensorImplPtr
First operand.
bTensorImplPtr
Second operand. Broadcast-compatible with a.

Returns

TensorImplPtr

Tensor of shape broadcast(a.shape, b.shape) holding the elementwise minimum.

Notes

At ties (ai=bia_i = b_i) each operand receives half the gradient. When grad-tracking is on, registers a MinimumBackward node which saves both inputs.

Examples

>>> auto y = minimum_op(a, b);  // y[i] = min(a[i], b[i]) with broadcasting