min#
Reduces the input by the minimum values across the specified axes or performs an element-wise minimum on each element in the input operators.
-
template<typename InType, int D>
__MATX_INLINE__ auto matx::min(const InType &in, const int (&dims)[D])# Compute min reduction of an operator along axes
Returns an operator representing the min of all numbers in the reduction
- Template Parameters:
InType – Input data type
D – Num of dimensions to reduce over
- Parameters:
in – Input data to reduce
dims – Array containing dimensions to reduce over
- Returns:
Operator with reduced values of min-reduce computed
-
template<typename InType>
__MATX_INLINE__ auto matx::min(const InType &in)# Compute min reduction of an operator
Returns an operator representing the min of all numbers in the reduction
- Template Parameters:
InType – Input data type
D – Number of right-most dimensions to reduce over
- Parameters:
in – Input data to reduce
- Returns:
Operator with reduced values of min-reduce computed
-
Op matx::min(Op t, Op t2)#
Compute element-wise min(t, t2) of two operators or tensors
- Parameters:
t – LHS tensor or operator input
t2 – RHS tensor or operator input
Examples#
auto t0 = make_tensor<TestType>({});
auto t1o = make_tensor<TestType>({11});
t1o.SetVals({(T)1, (T)3, (T)8, (T)2, (T)9, (T)10, (T)6, (T)7, (T)4, (T)5, (T)11});
// Reduce all inputs in "t1o" into "t0" by the minimum of all elements
(t0 = min(t1o)).run(exec);
// Reduce a 4D tensor into a 2D tensor by collapsing the inner two dimensions. Both
// examples permute the dimensions before the reduction
(t2a = min(permute(t4,{2,3,0,1}))).run(exec);
(t2b = min(t4, {0,1})).run(exec);
(tov0 = min(tiv0, d)).run(exec);