vt::min#

template<typename T, size_t N>
Tensor<T, 0> vt::min(const Tensor<T, N> &tensor)#

Returns the minimum value of the tensor elements.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:

tensor – The tensor object.

Returns:

T: The minimum value of the tensor elements.

template<typename T, size_t N>
Tensor<T, N - 1> vt::min(const Tensor<T, N> &tensor, int axis)#

Find the minimum value of the tensor elements along the given axis. The current implementation is not optimized. The performance could improve if a scan algorithm is applied along the axis.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • tensor – The tensor object.

  • axis – The axis to find the minimum value.

Returns:

Tensor<T, N-1>: The result tensor.