Minimum (Min)#

API#

class warp_nn.modules.operators.Min(*, requires_grad: bool = True)[source]#

Bases: Module

Element-wise minimum (Min) operation.

This class computes the element-wise minimum of two arrays:

\[\text{Min}(a, b) = \min(a, b)\]

NaN values are propagated, and the gradient is split evenly between the inputs when they are equal (as PyTorch’s minimum does).

Parameters:

requires_grad – Whether the cached output arrays of the module require gradients.

__call__(
a: array,
b: array,
) → array[source]#

Forward pass of the operation.

Parameters:
  • a – The first input array, with up to 3 dimensions.

  • b – The second input array, with the same shape and data type as a.

Returns:

The output array, with same shape as the input arrays.

Raises:
  • ValueError – If the input arrays’ shapes differ.

  • TypeError – If the input arrays’ data types differ, or if their data type or number of dimensions is not supported.