triton.language.histogram

triton.language.histogram(input, num_bins)

计算基于输入张量的直方图,包含 num_bins 个 bin,每个 bin 的宽度为 1,从 0 开始。

参数:
  • input (张量) – 输入张量

  • num_bins (int) – 直方图 bin 的数量

此函数也可以作为成员函数在 张量 上调用,例如使用 x.histogram(...) 而不是 histogram(x, ...)