Update tf.histogram_fixed_width docstring to comform to Python doctest
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
parent
a610493e77
commit
fe3a4bcf2f
@ -63,13 +63,14 @@ def histogram_fixed_width_bins(values,
|
||||
Examples:
|
||||
|
||||
```python
|
||||
# Bins will be: (-inf, 1), [1, 2), [2, 3), [3, 4), [4, inf)
|
||||
nbins = 5
|
||||
value_range = [0.0, 5.0]
|
||||
new_values = [-1.0, 0.0, 1.5, 2.0, 5.0, 15]
|
||||
|
||||
indices = tf.histogram_fixed_width_bins(new_values, value_range, nbins=5)
|
||||
indices # [0, 0, 1, 2, 4, 4]
|
||||
>>> # Bins will be: (-inf, 1), [1, 2), [2, 3), [3, 4), [4, inf)
|
||||
...
|
||||
>>> nbins = 5
|
||||
>>> value_range = [0.0, 5.0]
|
||||
>>> new_values = [-1.0, 0.0, 1.5, 2.0, 5.0, 15]
|
||||
>>> indices = tf.histogram_fixed_width_bins(new_values, value_range, nbins=5)
|
||||
>>> print(indices)
|
||||
tf.Tensor([0 0 1 2 4 4], shape=(6,), dtype=int32)
|
||||
```
|
||||
"""
|
||||
with ops.name_scope(name, 'histogram_fixed_width_bins',
|
||||
@ -130,13 +131,14 @@ def histogram_fixed_width(values,
|
||||
Examples:
|
||||
|
||||
```python
|
||||
# Bins will be: (-inf, 1), [1, 2), [2, 3), [3, 4), [4, inf)
|
||||
nbins = 5
|
||||
value_range = [0.0, 5.0]
|
||||
new_values = [-1.0, 0.0, 1.5, 2.0, 5.0, 15]
|
||||
|
||||
hist = tf.histogram_fixed_width(new_values, value_range, nbins=5)
|
||||
hist # [2, 1, 1, 0, 2]
|
||||
>>> # Bins will be: (-inf, 1), [1, 2), [2, 3), [3, 4), [4, inf)
|
||||
...
|
||||
>>> nbins = 5
|
||||
>>> value_range = [0.0, 5.0]
|
||||
>>> new_values = [-1.0, 0.0, 1.5, 2.0, 5.0, 15]
|
||||
>>> hist = tf.histogram_fixed_width(new_values, value_range, nbins=5)
|
||||
>>> print(hist)
|
||||
tf.Tensor([2 1 1 0 2], shape=(5,), dtype=int32)
|
||||
```
|
||||
"""
|
||||
with ops.name_scope(name, 'histogram_fixed_width',
|
||||
|
Loading…
Reference in New Issue
Block a user