diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-01-12 11:36:49 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-01-12 11:40:51 -0800 |
commit | 6518d0d67447587ecb1c72086995706662b65ab1 (patch) | |
tree | 855563c1c3c2cef747e22a259653bd00bc3e9d72 /tensorflow/python/profiler | |
parent | 3a44dc9a03c30f67cb158bb6332e9d7ba824897c (diff) |
Initialize context handle before enable_run_metadata.
PiperOrigin-RevId: 181770918
Diffstat (limited to 'tensorflow/python/profiler')
-rw-r--r-- | tensorflow/python/profiler/model_analyzer_test.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tensorflow/python/profiler/model_analyzer_test.py b/tensorflow/python/profiler/model_analyzer_test.py index 14ad9e51a1..0ad4e0ef17 100644 --- a/tensorflow/python/profiler/model_analyzer_test.py +++ b/tensorflow/python/profiler/model_analyzer_test.py @@ -29,6 +29,7 @@ from tensorflow.core.profiler import profile_pb2 from tensorflow.core.protobuf import config_pb2 from tensorflow.core.protobuf import rewriter_config_pb2 from tensorflow.python.client import session +from tensorflow.python.eager import context from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework import test_util @@ -762,6 +763,15 @@ class PrintModelAnalysisTest(test.TestCase): sess.graph, run_meta=run_metadata, cmd='scope', options=options) self.assertGreater(ret_pb.total_requested_bytes, 1000000) + def testEager(self): + ops.reset_default_graph() + with context.eager_mode(): + context.enable_run_metadata() + lib.BuildSmallModel() + run_meta = context.export_run_metadata() + self.assertTrue('Conv2D' in '%s' % run_meta) + context.disable_run_metadata() + if __name__ == '__main__': test.main() |