hist

Contents

hist#

Compute a histogram of input a with bounds specified by upper and lower and num_levels bins

Note

This function is currently not supported with host-based executors (CPU)

template<typename InputOperator>
__MATX_INLINE__ auto matx::hist(const InputOperator &a, const typename InputOperator::value_type lower, const typename InputOperator::value_type upper, int num_levels)#

Compute a histogram of rows in a tensor

Computes a histogram with the given number of levels and upper/lower limits. The number of levels is explicitly passed in, and the output must be large enough to hold all levels. Each bin contains elements falling within idx*(upper-lower)/a.out.Lsize(). In other words, each bin is as large as the difference between the upper and lower bounds and the number of bins

Template Parameters:

InputOperator – Type of histogram input

Parameters:
  • a – Input operator

  • lower – Lower limit

  • upper – Upper limit

  • num_levels – Number of levels

Examples#

(outv = hist(inv, 0.0f, 12.0f, levels)).run(exec);