all#

Returns a truth value if all values in the reduction converts to a boolean “true”

template<typename InType, int D>
__MATX_INLINE__ auto matx::all(const InType &in, const int (&dims)[D])#

Find if all values are != 0

Returns a boolean value indicating whether all values in the set of inputs are non-zero. The same aggregation rules apply for input vs output tensor size and what type of reduction is done.

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 all-reduce computed

template<typename InType>
__MATX_INLINE__ auto matx::all(const InType &in)#

Find if all values are != 0

Returns a boolean value indicating whether all values in the set of inputs are non-zero. The same aggregation rules apply for input vs output tensor size and what type of reduction is done.

Template Parameters:

InType – Input data type

Parameters:

in – Input data to reduce

Returns:

Operator with reduced values of all-reduce computed

Examples#

// Reduce a 4D tensor into a 0D tensor where the 0D is "true" if all values in "t4"
// convert to "true", or "false" otherwise
(t0 = all(t4)).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 = all(permute(t4,{2,3,0,1}))).run(exec);
(t2b = all(t4, {0,1})).run(exec);