diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-05-03 14:11:13 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-05-04 10:25:49 -0700 |
commit | a4a9e372f6af694e91ef7aaae9f23867d0ec0fc2 (patch) | |
tree | b5059563dcff400c88db5163df82cdc1b54fc0b2 /tensorflow/python/profiler | |
parent | 518dfea0d6d45448a360a49635fe815a28730c46 (diff) |
Optimize idempotent ops, e.g., Snapshot(Snapshot(x)) => Snapshot(x)
PiperOrigin-RevId: 195308675
Diffstat (limited to 'tensorflow/python/profiler')
-rw-r--r-- | tensorflow/python/profiler/internal/run_metadata_test.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tensorflow/python/profiler/internal/run_metadata_test.py b/tensorflow/python/profiler/internal/run_metadata_test.py index fd893d6cde..216cc3dd54 100644 --- a/tensorflow/python/profiler/internal/run_metadata_test.py +++ b/tensorflow/python/profiler/internal/run_metadata_test.py @@ -23,6 +23,7 @@ from collections import defaultdict import six from tensorflow.core.protobuf import config_pb2 +from tensorflow.core.protobuf import rewriter_config_pb2 from tensorflow.python.client import session from tensorflow.python.framework import ops from tensorflow.python.ops import math_ops @@ -65,7 +66,10 @@ def _run_model(): w = random_ops.random_normal(shape=[SIZE, 2 * SIZE]) y = math_ops.matmul(x, w) - with session.Session() as sess: + config = config_pb2.ConfigProto() + config.graph_options.rewrite_options.arithmetic_optimization = ( + rewriter_config_pb2.RewriterConfig.OFF) + with session.Session(config=config) as sess: run_metadata = config_pb2.RunMetadata() opts = builder.time_and_memory() opts['min_micros'] = 0 |