torch.histc¶
- torch.histc(input, bins=100, min=0, max=0, *, out=None) Tensor ¶
计算张量的直方图。
元素被排序到 min 和 max 之间的等宽 bin 中。 如果 min 和 max 均为零,则使用数据的最小值和最大值。
低于 min 和高于 max 的元素以及 NaN 元素将被忽略。
- 参数
- 关键字参数
out (Tensor, optional) – 输出张量。
- 返回值
直方图,表示为张量
- 返回类型
示例
>>> torch.histc(torch.tensor([1., 2, 1]), bins=4, min=0, max=3) tensor([ 0., 2., 1., 0.])