aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/distributions
diff options
context:
space:
mode:
authorGravatar Dustin Tran <trandustin@google.com>2018-07-26 17:36:27 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-07-26 17:44:44 -0700
commitc7fc5b013ba9379e2211acc0b08bdd6774dd468d (patch)
tree386143931d6324c21fdb1791c8b3fa432fe7f160 /tensorflow/contrib/distributions
parentf83263d3eca91f52b5b1005af2c09f16a7b70b20 (diff)
Add low and high as properties to quantized distribution.
PiperOrigin-RevId: 206249977
Diffstat (limited to 'tensorflow/contrib/distributions')
-rw-r--r--tensorflow/contrib/distributions/python/ops/quantized_distribution.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/tensorflow/contrib/distributions/python/ops/quantized_distribution.py b/tensorflow/contrib/distributions/python/ops/quantized_distribution.py
index ef3bdfa75f..18a0f754e6 100644
--- a/tensorflow/contrib/distributions/python/ops/quantized_distribution.py
+++ b/tensorflow/contrib/distributions/python/ops/quantized_distribution.py
@@ -326,6 +326,21 @@ class QuantizedDistribution(distributions.Distribution):
graph_parents=graph_parents,
name=name)
+ @property
+ def distribution(self):
+ """Base distribution, p(x)."""
+ return self._dist
+
+ @property
+ def low(self):
+ """Lowest value that quantization returns."""
+ return self._low
+
+ @property
+ def high(self):
+ """Highest value that quantization returns."""
+ return self._high
+
def _batch_shape_tensor(self):
return self.distribution.batch_shape_tensor()
@@ -569,8 +584,3 @@ class QuantizedDistribution(distributions.Distribution):
dependencies = [distribution_util.assert_integer_form(
value, message="value has non-integer components.")]
return control_flow_ops.with_dependencies(dependencies, value)
-
- @property
- def distribution(self):
- """Base distribution, p(x)."""
- return self._dist