vt::max#
-
template<typename T, size_t N>
Tensor<T, 0> vt::max(const Tensor<T, N> &tensor)# Returns the maximum 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:
Tensor<T, 0>: The result tensor.
-
template<typename T, size_t N>
Tensor<T, N - 1> vt::max(const Tensor<T, N> &tensor, int axis)# Find the maximum 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 maximum value.
- Returns:
Tensor<T, N-1>: The result tensor.