Fix test_session warnings during tests by replacing it with session()

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2018-12-31 00:40:43 +00:00
parent 85f3821cf8
commit 1f6a9fc270

View File

@ -164,7 +164,7 @@ class QuantileOpsTest(test_util.TensorFlowTestCase):
self.assertAllClose(self._feature_1_boundaries, buckets[1].eval())
save.save(sess, save_path)
with self.test_session(graph=ops.Graph()) as sess:
with self.session(graph=ops.Graph()) as sess:
accumulator = boosted_trees_ops.QuantileAccumulator(
num_streams=2, num_quantiles=3, epsilon=self.eps, name="q0")
save = saver.Saver()
@ -195,7 +195,7 @@ class QuantileOpsTest(test_util.TensorFlowTestCase):
self.assertAllClose(self._feature_0_boundaries, buckets[0].eval())
self.assertAllClose(self._feature_1_boundaries, buckets[1].eval())
with self.test_session(graph=ops.Graph()) as sess:
with self.session(graph=ops.Graph()) as sess:
accumulator = boosted_trees_ops.QuantileAccumulator(
num_streams=2, num_quantiles=3, epsilon=self.eps, name="q0")
save = saver.Saver()