From 8202d047cc2e47ffd3529f84ea0463a171b3b44a Mon Sep 17 00:00:00 2001 From: lazypanda1 <35884075+lazypanda1@users.noreply.github.com> Date: Thu, 8 Feb 2018 12:54:57 -0600 Subject: [PATCH] Fixing assert message for beta distribution (#16786) --- tensorflow/python/kernel_tests/distributions/beta_test.py | 4 +++- tensorflow/python/ops/distributions/beta.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tensorflow/python/kernel_tests/distributions/beta_test.py b/tensorflow/python/kernel_tests/distributions/beta_test.py index 91a451f..ab5041a 100644 --- a/tensorflow/python/kernel_tests/distributions/beta_test.py +++ b/tensorflow/python/kernel_tests/distributions/beta_test.py @@ -107,8 +107,10 @@ class BetaTest(test.TestCase): dist.prob([-1., 0.1, 0.5]).eval() with self.assertRaisesOpError("sample must be positive"): dist.prob([0., 0.1, 0.5]).eval() - with self.assertRaisesOpError("sample must be no larger than `1`"): + with self.assertRaisesOpError("sample must be less than `1`"): dist.prob([.1, .2, 1.2]).eval() + with self.assertRaisesOpError("sample must be less than `1`"): + dist.prob([.1, .2, 1.0]).eval() def testPdfTwoBatches(self): with self.test_session(): diff --git a/tensorflow/python/ops/distributions/beta.py b/tensorflow/python/ops/distributions/beta.py index 6d6b40b..be4ef55 100644 --- a/tensorflow/python/ops/distributions/beta.py +++ b/tensorflow/python/ops/distributions/beta.py @@ -309,7 +309,7 @@ class Beta(distribution.Distribution): message="sample must be positive"), check_ops.assert_less( x, array_ops.ones([], self.dtype), - message="sample must be no larger than `1`."), + message="sample must be less than `1`."), ], x) -- 2.7.4