Replace deprecated test_session with cached_session in quantile_ops_test

This fix replace deprecated test_session with cached_session in
quantile_ops_test.py to remove warnings during tests

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

View File

@ -145,7 +145,7 @@ class QuantileOpsTest(test_util.TensorFlowTestCase):
save_dir = os.path.join(self.get_temp_dir(), "save_restore")
save_path = os.path.join(tempfile.mkdtemp(prefix=save_dir), "hash")
with self.test_session() as sess:
with self.cached_session() as sess:
accumulator = boosted_trees_ops.QuantileAccumulator(
num_streams=2, num_quantiles=3, epsilon=self.eps, name="q0")
@ -177,7 +177,7 @@ class QuantileOpsTest(test_util.TensorFlowTestCase):
save_dir = os.path.join(self.get_temp_dir(), "save_restore")
save_path = os.path.join(tempfile.mkdtemp(prefix=save_dir), "hash")
with self.test_session() as sess:
with self.cached_session() as sess:
accumulator = boosted_trees_ops.QuantileAccumulator(
num_streams=2, num_quantiles=3, epsilon=self.eps, name="q0")