triton.language.histogram

triton.language.histogram(input, num_bins, mask=None, _semantic=None, _generator=None)

computes an histogram based on input tensor with num_bins bins, the bins have a width of 1 and start at 0.

Parameters:
  • input (Tensor) – the input tensor

  • num_bins (int) – number of histogram bins

  • mask (Block of triton.int1, optional) – if mask[idx] is false, exclude input[idx] from histogram

This function can also be called as a member function on tensor, as x.histogram(...) instead of histogram(x, ...).