min

nvtripy.min(input: Tensor, dim: int | Sequence[int] | None = None, keepdim: bool = False) Tensor[source]

Returns a new tensor containing the minimum of the elements of the input tensor along the specified dimension.

Parameters:
  • input (Tensor) – [dtype=T1] The input tensor.

  • dim (int | Sequence[int] | None) – The dimension or dimensions along which to reduce. If this is not provided, all dimensions are reduced.

  • keepdim (bool) – Whether to retain reduced dimensions in the output. If this is False, reduced dimensions will be squeezed.

Returns:

[dtype=T1] A new tensor.

Return type:

Tensor

DATA TYPE CONSTRAINTS:
Example
1input = tp.reshape(tp.arange(6, dtype=tp.float32), (2, 3))
2output = tp.min(input, 0)
Local Variables
>>> input
tensor(
    [[0, 1, 2],
     [3, 4, 5]], 
    dtype=float32, loc=gpu:0, shape=(2, 3))

>>> output
tensor([0, 1, 2], dtype=float32, loc=gpu:0, shape=(3,))