diff --git a/tensorflow_probability/python/distributions/poisson.py b/tensorflow_probability/python/distributions/poisson.py index 9c9c0bcdca..26daa4638c 100644 --- a/tensorflow_probability/python/distributions/poisson.py +++ b/tensorflow_probability/python/distributions/poisson.py @@ -26,7 +26,7 @@ from tensorflow_probability.python.internal import dtype_util from tensorflow_probability.python.internal import reparameterization from tensorflow_probability.python.internal import tensor_util -from tensorflow.python.util import deprecation # pylint: disable=g-direct-tensorflow-import + __all__ = [ 'Poisson', @@ -118,15 +118,11 @@ def _params_event_ndims(cls): @property def rate(self): """Rate parameter.""" - if self._rate is None: - return self._rate_deprecated_behavior() return self._rate @property def log_rate(self): """Log rate parameter.""" - if self._log_rate is None: - return self._log_rate_deprecated_behavior() return self._log_rate @property @@ -219,22 +215,6 @@ def _log_rate_parameter_no_checks(self): return tf.math.log(self._rate) return tf.identity(self._log_rate) - @deprecation.deprecated( - '2019-10-01', - 'The `rate` property will return `None` when the distribution is ' - 'parameterized with `rate=None`. Use `rate_parameter()` instead.', - warn_once=True) - def _rate_deprecated_behavior(self): - return self.rate_parameter() - - @deprecation.deprecated( - '2019-10-01', - 'The `log_rate` property will return `None` when the distribution is ' - 'parameterized with `log_rate=None`. Use `log_rate_parameter()` instead.', - warn_once=True) - def _log_rate_deprecated_behavior(self): - return self.log_rate_parameter() - def _default_event_space_bijector(self): return diff --git a/tensorflow_probability/python/distributions/poisson_lognormal.py b/tensorflow_probability/python/distributions/poisson_lognormal.py index 61760ff141..745fe2d8cf 100644 --- a/tensorflow_probability/python/distributions/poisson_lognormal.py +++ b/tensorflow_probability/python/distributions/poisson_lognormal.py @@ -371,7 +371,7 @@ def _sample_n(self, n, seed=None): delta=self._quadrature_size, dtype=ids.dtype) ids = ids + offset - rate = tf.gather(tf.reshape(dist.rate, shape=[-1]), ids) + rate = tf.gather(tf.reshape(dist.rate_parameter(), shape=[-1]), ids) rate = tf.reshape( rate, shape=concat_vectors([n], self._batch_shape_tensor( distributions=distributions))) diff --git a/tensorflow_probability/python/distributions/poisson_test.py b/tensorflow_probability/python/distributions/poisson_test.py index 4ea9a8ba8a..bbb28fa3e8 100644 --- a/tensorflow_probability/python/distributions/poisson_test.py +++ b/tensorflow_probability/python/distributions/poisson_test.py @@ -78,7 +78,8 @@ def testPoissonLogPmfContinuousRelaxation(self): rate=lam, interpolate_nondiscrete=True, validate_args=False) expected_continuous_log_pmf = ( - x * poisson.log_rate - tf.math.lgamma(1. + x) - poisson.rate) + x * poisson.log_rate_parameter() + - tf.math.lgamma(1. + x) - poisson.rate_parameter()) expected_continuous_log_pmf = tf.where( x >= 0., expected_continuous_log_pmf, dtype_util.as_numpy_dtype(