mindspore/docs/api/api_python/ops/mindspore.ops.Histogram.rst

31 lines
1.2 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.Histogram
=======================
.. py:class:: mindspore.ops.Histogram(bins=100, min=0.0, max=0.0)
计算Tensor的直方图。
元素被分类到 `min``max` 之间的等宽箱中。
如果 `min``max` 均为0则使用数据的最小值和最大值。
低于最小值和高于最大值的元素将被忽略。
参数:
- **bins** (int, 可选) - 直方图箱的数量可选。默认值100。若指定则必须为正数。
- **min** (float, 可选) - 范围下端的可选浮点数。默认值0.0。
- **max** (float, 可选) - 范围上限的可选浮点数。默认值0.0。
输入:
- **x** (Tensor) - 输入Tensor类型支持 :math:`[float16, float32, int32]`
输出:
Tensor类型为int32的1-D Tensor。
异常:
- **TypeError** - 如果 `x` 不是Tensor。
- **TypeError** - 如果 `x` 的数据类型不支持。
- **TypeError** - 如果属性 `min``max` 不是float类型。
- **TypeError** - 如果属性 `bins` 不是整数。
- **ValueError** - 如果属性 `min` > `max`
- **ValueError** - 如果属性 `bins` <= 0。