diff options
Diffstat (limited to 'tensorflow/python/client/session_test.py')
-rw-r--r-- | tensorflow/python/client/session_test.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tensorflow/python/client/session_test.py b/tensorflow/python/client/session_test.py index 6e2640efd1..92497272c6 100644 --- a/tensorflow/python/client/session_test.py +++ b/tensorflow/python/client/session_test.py @@ -1371,6 +1371,18 @@ class SessionTest(test_util.TensorFlowTestCase): run_metadata=run_metadata)) self.assertGreater(len(run_metadata.step_stats.dev_stats), 0) + def testOptimizedMakeCallable(self): + with session.Session() as sess: + ph = array_ops.placeholder(dtypes.float32) + a = math_ops.add(ph, 1.0) + callable_opts = config_pb2.CallableOptions() + callable_opts.feed.append(ph.name) + callable_opts.fetch.append(a.name) + for _ in range(3): + callable_fn = sess._make_callable_from_options(callable_opts) + for _ in range(5): + self.assertEqual([2.0], callable_fn(np.array(1.0, dtype=np.float32))) + def testFeedError(self): with session.Session() as sess: feed_t = array_ops.placeholder(dtype=dtypes.float32) |