diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-08-21 18:22:15 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-08-21 18:25:59 -0700 |
commit | 708b30f4cb82271bb28cb70a1e0c89a1933f5b64 (patch) | |
tree | 22470a9314f7f4225b6d08170a3d7ea91b0216a1 /tensorflow/contrib/distributions | |
parent | d0cac47a767dd972516f75ce57f0d6185e3b6514 (diff) |
Move from deprecated self.test_session() to self.session() when a graph is set.
self.test_session() has been deprecated in cl/208545396 as its behavior confuses readers of the test. Moving to self.session() instead.
PiperOrigin-RevId: 209696110
Diffstat (limited to 'tensorflow/contrib/distributions')
4 files changed, 6 insertions, 6 deletions
diff --git a/tensorflow/contrib/distributions/python/kernel_tests/cauchy_test.py b/tensorflow/contrib/distributions/python/kernel_tests/cauchy_test.py index 73747db31c..afa6ed9255 100644 --- a/tensorflow/contrib/distributions/python/kernel_tests/cauchy_test.py +++ b/tensorflow/contrib/distributions/python/kernel_tests/cauchy_test.py @@ -214,7 +214,7 @@ class CauchyTest(test.TestCase): ]: value = func(x) grads = gradients_impl.gradients(value, [loc, scale]) - with self.test_session(graph=g): + with self.session(graph=g): variables.global_variables_initializer().run() self.assertAllFinite(value) self.assertAllFinite(grads[0]) diff --git a/tensorflow/contrib/distributions/python/kernel_tests/half_normal_test.py b/tensorflow/contrib/distributions/python/kernel_tests/half_normal_test.py index a4e7566008..1df1467b2d 100644 --- a/tensorflow/contrib/distributions/python/kernel_tests/half_normal_test.py +++ b/tensorflow/contrib/distributions/python/kernel_tests/half_normal_test.py @@ -191,7 +191,7 @@ class HalfNormalTest(test.TestCase): print(func.__name__) value = func(x) grads = gradients_impl.gradients(value, [scale]) - with self.test_session(graph=g): + with self.session(graph=g): variables.global_variables_initializer().run() self.assertAllFinite(value) self.assertAllFinite(grads[0]) diff --git a/tensorflow/contrib/distributions/python/kernel_tests/quantized_distribution_test.py b/tensorflow/contrib/distributions/python/kernel_tests/quantized_distribution_test.py index 6a7ee3a8bf..71f63378e2 100644 --- a/tensorflow/contrib/distributions/python/kernel_tests/quantized_distribution_test.py +++ b/tensorflow/contrib/distributions/python/kernel_tests/quantized_distribution_test.py @@ -335,7 +335,7 @@ class QuantizedDistributionTest(test.TestCase): x = np.arange(-100, 100, 2).astype(dtype) proba = qdist.log_prob(x) grads = gradients_impl.gradients(proba, [mu, sigma]) - with self.test_session(graph=g): + with self.session(graph=g): variables.global_variables_initializer().run() self._assert_all_finite(proba.eval()) self._assert_all_finite(grads[0].eval()) diff --git a/tensorflow/contrib/distributions/python/kernel_tests/transformed_distribution_test.py b/tensorflow/contrib/distributions/python/kernel_tests/transformed_distribution_test.py index 5fe1331d2c..bb32430c4a 100644 --- a/tensorflow/contrib/distributions/python/kernel_tests/transformed_distribution_test.py +++ b/tensorflow/contrib/distributions/python/kernel_tests/transformed_distribution_test.py @@ -91,7 +91,7 @@ class TransformedDistributionTest(test.TestCase): # sample sample = log_normal.sample(100000, seed=235) self.assertAllEqual([], log_normal.event_shape) - with self.test_session(graph=g): + with self.session(graph=g): self.assertAllEqual([], log_normal.event_shape_tensor().eval()) self.assertAllClose( sp_dist.mean(), np.mean(sample.eval()), atol=0.0, rtol=0.05) @@ -107,7 +107,7 @@ class TransformedDistributionTest(test.TestCase): [log_normal.log_survival_function, sp_dist.logsf]]: actual = func[0](test_vals) expected = func[1](test_vals) - with self.test_session(graph=g): + with self.session(graph=g): self.assertAllClose(expected, actual.eval(), atol=0, rtol=0.01) def testNonInjectiveTransformedDistribution(self): @@ -123,7 +123,7 @@ class TransformedDistributionTest(test.TestCase): # sample sample = abs_normal.sample(100000, seed=235) self.assertAllEqual([], abs_normal.event_shape) - with self.test_session(graph=g): + with self.session(graph=g): sample_ = sample.eval() self.assertAllEqual([], abs_normal.event_shape_tensor().eval()) |