diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-09-21 00:07:20 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-09-21 00:13:08 -0700 |
commit | b19d6657070bbf1df5706195a0bf3a92cbf371fc (patch) | |
tree | 64279a06acd61c7028226eba46a05dd1127acee4 /tensorflow/contrib/boosted_trees | |
parent | 2952f5134905af795ba90ae1eb97e39091ba9843 (diff) |
Move from deprecated self.test_session() to self.cached_session().
self.test_session() has been deprecated in 9962eb5e84b15e309410071b06c2ed2d6148ed44 as its name confuses readers of the test. Moving to cached_session() instead which is more explicit about:
* the fact that the session may be reused.
* the session is not closed even when doing a "with self.test_session()" statement.
PiperOrigin-RevId: 213944932
Diffstat (limited to 'tensorflow/contrib/boosted_trees')
-rw-r--r-- | tensorflow/contrib/boosted_trees/python/utils/losses_test.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/contrib/boosted_trees/python/utils/losses_test.py b/tensorflow/contrib/boosted_trees/python/utils/losses_test.py index ccb8509c03..cc22504c8f 100644 --- a/tensorflow/contrib/boosted_trees/python/utils/losses_test.py +++ b/tensorflow/contrib/boosted_trees/python/utils/losses_test.py @@ -45,7 +45,7 @@ class LossesTest(test_util.TensorFlowTestCase): eps = 0.2 - with self.test_session(): + with self.cached_session(): predictions_tensor = constant_op.constant( prediction_logits, dtype=dtypes.float32) loss_for_positives, _ = losses.per_example_exp_loss( @@ -84,7 +84,7 @@ class LossesTest(test_util.TensorFlowTestCase): predictions = np.array( [[0.123], [23.2], [233], [52], [3]], dtype=np.float32) - with self.test_session(): + with self.cached_session(): loss_tensor, _ = losses.per_example_squared_loss(labels, weights, predictions) |