Python – histogram_fixed_width_bins()
TensorFlow是谷歌设计的开源Python库,用于开发机器学习模型和深度学习神经网络。
histogram_fixed_width_bins()是用来找到元素被分档的索引的。
语法 : tensorflow.histogram_fixed_width_bins( values, value_range, nbins, dtype, name )
参数:
- values : 它是一个数字张量。
- value_range: 它是一个形状[2]的张量,其dtype与value相同。
- nbins(可选): 它定义了直方图中的bin的数量。默认值是100。
- dtype(可选): 它定义了返回索引的dtype。默认值是int32。
- name(可选): 它定义了操作的名称。
返回:它返回一个直方图值的张量。
示例 1:
输出:
示例 2:
输出: