8000 Add timeline support in tfprof · staticfloat/tensorflow@a5b9ef0 · GitHub
[go: up one dir, main page]

Skip to content

Commit a5b9ef0

Browse files
Add timeline support in tfprof
This CL mainly adds timeline support in three views of tfprof. It includes a few other small changes: 1. Handle the case that one Op fires multiple kernels. 2. Remove the requirements for CostGraph for easier user adoption, for now. 3. Some speed improvements in graph view. 4. Consolidate the all kinds of tfprof output into one -output option. PiperOrigin-RevId: 155822542
1 parent 14221c1 commit a5b9ef0

38 files changed

+1470
-668
lines changed

tensorflow/contrib/tfprof/README.md

Lines changed: 11 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -2,81 +2,25 @@
22

33
# Full Docment in tensorflow/tools/tfprof/README.md
44

5-
Author: Xin Pan (xpan@google.com, github: panyx0718)
5+
Author: Xin Pan (xpan@google.com, github: panyx0718), Jon Shlens, Yao Zhang
66

77
Consultants: Jon Shlens, Pete Warden
88

99
###Major Features
1010

1111
1. Measure model parameters, float operations, tensor shapes.
12-
2. Measure op execution times, requested memory size and device placement.
12+
2. Profile op execution times, requested memory size and device placement.
1313
3. Inspect checkpoint tensors' shapes and their values.
14-
4. 3 ways to view and explore TensorFlow model profiles
14+
4. Selectively group, filter, account and order ops.
1515

16-
* Organize by Python code call stack.
17-
* Organize by TensorFlow operation name scope hierarchies.
18-
* Organize by TensorFlow operation inputs/outputs graph.
16+
####tfprof supports 3 views to organize TensorFlow model profiles
1917

20-
5. Selectively grouping/filtering/accounting/ordering ops.
18+
* code view: Stats are associated your Python codes and organized as call stacks.
19+
* scope view: Stats are organized as name scope hierarchies.
20+
* graph view: Stats are organized as Tensorflow Op graph.
2121

22-
tfprof can be used as Python API, Interactive CLI and One-shot Script.
22+
####For each view, there are 3 ways to display outputs:
2323

24-
## Python API Tutorials
25-
26-
tfprof is part of TensorFlow core. Simply ```import tensorflow as tf```.
27-
28-
### Examine the shapes and sizes of all trainiable Variables.
29-
```python
30-
# Print trainable variable parameter statistics to stdout.
31-
param_stats = tf.contrib.tfprof.model_analyzer.print_model_analysis(
32-
tf.get_default_graph(),
33-
tfprof_options=tf.contrib.tfprof.model_analyzer.
34-
TRAINABLE_VARS_PARAMS_STAT_OPTIONS)
35-
36-
# param_stats is tensorflow.tfprof.TFGraphNodeProto proto.
37-
# It organize the statistics
38-
# of each graph node in tree scructure. Let's print the root below.
39-
sys.stdout.write('total_params: %d\n' % param_stats.total_parameters)
40-
```
41-
42-
### Examine the number of floating point operations
43-
``` python
44-
# Print to stdout an analysis of the number of floating point operations in the
45-
# model broken down by individual operations.
46-
#
47-
# Note: Only Ops with RegisterStatistics('flops') defined have flop stats. It
48-
# also requires complete shape information. It is common that shape is unknown
49-
# statically. To complete the shape, provide run-time shape information with
50-
# tf.RunMetadata to the API (See next example on how to provide RunMetadata).
51-
tf.contrib.tfprof.model_analyzer.print_model_analysis(
52-
tf.get_default_graph(),
53-
tfprof_options=tf.contrib.tfprof.model_analyzer.FLOAT_OPS_OPTIONS)
54-
```
55-
56-
### Examine the timing and memory usage
57-
You will first need to run the following set up in your model in order to
58-
compute the memory and timing statistics.
59-
60-
```python
61-
# Generate the meta information for the model that contains the memory usage
62-
# and timing information.
63-
run_metadata = tf.RunMetadata()
64-
with tf.Session() as sess:
65-
_ = sess.run(train_op,
66-
options=tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE),
67-
run_metadata=run_metadata)
68-
```
10000
69-
70-
Finally, you may run `print_model_analysis` to explore the timing and memory
71-
demands of the model.
72-
73-
``` python
74-
# Print to stdout an analysis of the memory usage and the timing information
75-
# from running the graph broken down by operations.
76-
tf.contrib.tfprof.model_analyzer.print_model_analysis(
77-
tf.get_default_graph(),
78-
run_meta=run_metadata,
79-
tfprof_options=tf.contrib.tfprof.model_analyzer.PRINT_ALL_TIMING_MEMORY)
80-
```
81-
82-
Users can change ```tfprof_options``` to fully leverage tfprof's power.
24+
* stdout: Results are written to stdout.
25+
* timeline: Visualized in chrome browser as time series.
26+
* file: Results are dumped to file.

tensorflow/contrib/tfprof/python/tools/tfprof/model_analyzer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
'hide_name_regexes': [],
4646
'account_displayed_op_only': True,
4747
'select': ['params'],
48-
'viz': False,
48+
'output': 'stdout',
4949
'dump_to_file': ''
5050
}
5151

@@ -65,7 +65,7 @@
6565
'hide_name_regexes': [],
6666
'account_displayed_op_only': True,
6767
'select': ['float_ops'],
68-
'viz': False,
68+
'output': 'stdout',
6969
'dump_to_file': ''
7070
}
7171

@@ -87,7 +87,7 @@
8787
'hide_name_regexes': [],
8888
'account_displayed_op_only': False,
8989
'select': ['device', 'params'],
90-
'viz': False,
90+
'output': 'stdout',
9191
'dump_to_file': ''
9292
}
9393

@@ -107,7 +107,7 @@
107107
'hide_name_regexes': [],
108108
'account_displayed_op_only': True,
109109
'select': ['micros', 'bytes'],
110-
'viz': False,
110+
'output': 'stdout',
111111
'dump_to_file': ''
112112
}
113113

@@ -178,7 +178,7 @@ def print_model_analysis(graph,
178178
opts.account_displayed_op_only = tfprof_options['account_displayed_op_only']
179179
for p in tfprof_options['select']:
180180
opts.select.append(p)
181-
opts.viz = tfprof_options['viz']
181+
opts.output = tfprof_options['output']
182182
opts.dump_to_file = tfprof_options['dump_to_file']
183183

184184
run_meta_str = run_meta.SerializeToString() if run_meta else b''

tensorflow/contrib/tfprof/python/tools/tfprof/model_analyzer_test.py

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ class PrintModelAnalysisTest(test.TestCase):
3535
def testDumpToFile(self):
3636
ops.reset_default_graph()
3737
opts = model_analyzer.TRAINABLE_VARS_PARAMS_STAT_OPTIONS
38-
opts['dump_to_file'] = os.path.join(test.get_temp_dir(), 'dump')
38+
outfile = os.path.join(test.get_temp_dir(), 'dump')
39+
opts['output'] = 'file:outfile=' + outfile
3940

4041
with session.Session() as sess, ops.device('/cpu:0'):
4142
_ = lib.BuildSmallModel()
4243
model_analyzer.print_model_analysis(sess.graph, tfprof_options=opts)
4344

44-
with gfile.Open(opts['dump_to_file'], 'r') as f:
45+
with gfile.Open(outfile, 'r') as f:
4546
self.assertEqual(u'_TFProfRoot (--/451 params)\n'
4647
' DW (3x3x3x6, 162/162 params)\n'
4748
' DW2 (2x2x6x12, 288/288 params)\n'
@@ -51,15 +52,14 @@ def testDumpToFile(self):
5152
def testSelectEverything(self):
5253
ops.reset_default_graph()
5354
opts = model_analyzer.TRAINABLE_VARS_PARAMS_STAT_OPTIONS
54-
opts['dump_to_file'] = os.path.join(test.get_temp_dir(), 'dump')
55+
outfile = os.path.join(test.get_temp_dir(), 'dump')
56+
opts['output'] = 'file:outfile=' + outfile
5557
opts['account_type_regexes'] = ['.*']
5658
opts['select'] = [
5759
'bytes', 'params', 'float_ops', 'num_hidden_ops', 'device', 'op_types'
5860
]
5961

60-
config = config_pb2.ConfigProto(
61-
graph_options=config_pb2.GraphOptions(build_cost_model=1))
62-
with session.Session(config=config) as sess, ops.device('/cpu:0'):
62+
with session.Session() as sess, ops.device('/cpu:0'):
6363
x = lib.BuildSmallModel()
6464

6565
sess.run(variables.global_variables_initializer())
@@ -72,17 +72,18 @@ def testSelectEverything(self):
7272
model_analyzer.print_model_analysis(
7373
sess.graph, run_meta, tfprof_options=opts)
7474

75-
with gfile.Open(opts['dump_to_file'], 'r') as f:
75+
with gfile.Open(outfile, 'r') as f:
7676
# pylint: disable=line-too-long
7777
self.assertEqual(
78-
'_TFProfRoot (0/451 params, 0/10.44k flops, 0B/5.28KB, _kTFScopeParent)\n Conv2D (0/0 params, 5.83k/5.83k flops, 432B/432B, /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/cpu:0|Conv2D)\n Conv2D_1 (0/0 params, 4.61k/4.61k flops, 384B/384B, /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/cpu:0|Conv2D)\n DW (3x3x3x6, 162/162 params, 0/0 flops, 648B/1.30KB, /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/cpu:0|VariableV2|_trainable_variables)\n DW/Assign (0/0 params, 0/0 flops, 0B/0B, /device:CPU:0, /device:CPU:0|Assign)\n DW/Initializer (0/0 params, 0/0 flops, 0B/0B, _kTFScopeParent)\n DW/Initializer/random_normal (0/0 params, 0/0 flops, 0B/0B, Add)\n DW/Initializer/random_normal/RandomStandardNormal (0/0 params, 0/0 flops, 0B/0B, RandomStandardNormal)\n DW/Initializer/random_normal/mean (0/0 params, 0/0 flops, 0B/0B, Const)\n DW/Initializer/random_normal/mul (0/0 params, 0/0 flops, 0B/0B, Mul)\n DW/Initializer/random_normal/shape (0/0 params, 0/0 flops, 0B/0B, Const)\n DW/Initializer/random_normal/stddev (0/0 params, 0/0 flops, 0B/0B, Const)\n DW/read (0/0 params, 0/0 flops, 648B/648B, /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/cpu:0|Identity)\n DW2 (2x2x6x12, 288/288 params, 0/0 flops, 1.15KB/2.30KB, /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/cpu:0|VariableV2|_trainable_variables)\n DW2/Assign (0/0 params, 0/0 flops, 0B/0B, /device:CPU:0, /device:CPU:0|Assign)\n DW2/Initializer (0/0 params, 0/0 flops, 0B/0B, _kTFScopeParent)\n DW2/Initializer/random_normal (0/0 params, 0/0 flops, 0B/0B, Add)\n DW2/Initializer/random_normal/RandomStandardNormal (0/0 params, 0/0 flops, 0B/0B, RandomStandardNormal)\n DW2/Initializer/random_normal/mean (0/0 params, 0/0 flops, 0B/0B, Const)\n DW2/Initializer/random_normal/mul (0/0 params, 0/0 flops, 0B/0B, Mul)\n DW2/Initializer/random_normal/shape (0/0 params, 0/0 flops, 0B/0B, Const)\n DW2/Initializer/random_normal/stddev (0/0 params, 0/0 flops, 0B/0B, Const)\n DW2/read (0/0 params, 0/0 flops, 1.15KB/1.15KB, /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/cpu:0|Identity)\n ScalarW (1, 1/1 params, 0/0 flops, 0B/0B, /device:CPU:0, /device:CPU:0|VariableV2|_trainable_variables)\n ScalarW/Assign (0/0 params, 0/0 flops, 0B/0B, /device:CPU:0, /device:CPU:0|Assign)\n ScalarW/Initializer (0/0 params, 0/0 flops, 0B/0B, _kTFScopeParent)\n ScalarW/Initializer/random_normal (0/0 params, 0/0 flops, 0B/0B, Add)\n ScalarW/Initializer/random_normal/RandomStandardNormal (0/0 params, 0/0 flops, 0B/0B, RandomStandardNormal)\n ScalarW/Initializer/random_normal/mean (0/0 params, 0/0 flops, 0B/0B, Const)\n ScalarW/Initializer/random_normal/mul (0/0 params, 0/0 flops, 0B/0B, Mul)\n ScalarW/Initializer/random_normal/shape (0/0 params, 0/0 flops, 0B/0B, Const)\n ScalarW/Initializer/random_normal/stddev (0/0 params, 0/0 flops, 0B/0B, Const)\n ScalarW/read (0/0 params, 0/0 flops, 0B/0B, /device:CPU:0, /device:CPU:0|Identity)\n init (0/0 params, 0/0 flops, 0B/0B, /device:CPU:0, /device:CPU:0|NoOp)\n zeros (0/0 params, 0/0 flops, 864B/864B, /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/cpu:0|Const)\n',
78+
'_TFProfRoot (0/451 params, 0/10.44k flops, 0B/5.28KB, _kTFScopeParent)\n Conv2D (0/0 params, 5.83k/5.83k flops, 432B/432B, /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/cpu:0|Conv2D)\n Conv2D_1 (0/0 params, 4.61k/4.61k flops, 384B/384B, /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/cpu:0|Conv2D)\n DW (3x3x3x6, 162/162 params, 0/0 flops, 648B/1.30KB, /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/cpu:0|VariableV2|_trainable_variables)\n DW/Assign (0/0 params, 0/0 flops, 0B/0B, Assign)\n DW/Initializer (0/0 params, 0/0 flops, 0B/0B, _kTFScopeParent)\n DW/Initializer/random_normal (0/0 params, 0/0 flops, 0B/0B, Add)\n DW/Initializer/random_normal/RandomStandardNormal (0/0 params, 0/0 flops, 0B/0B, RandomStandardNormal)\n DW/Initializer/random_normal/mean (0/0 params, 0/0 flops, 0B/0B, Const)\n DW/Initializer/random_normal/mul (0/0 params, 0/0 flops, 0B/0B, Mul)\n DW/Initializer/random_normal/shape (0/0 params, 0/0 flops, 0B/0B, Const)\n DW/Initializer/random_normal/stddev (0/0 params, 0/0 flops, 0B/0B, Const)\n DW/read (0/0 params, 0/0 flops, 648B/648B, /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/cpu:0|Identity)\n DW2 (2x2x6x12, 288/288 params, 0/0 flops, 1.15KB/2.30KB, /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/cpu:0|VariableV2|_trainable_variables)\n DW2/Assign (0/0 params, 0/0 flops, 0B/0B, Assign)\n DW2/Initializer (0/0 params, 0/0 flops, 0B/0B, _kTFScopeParent)\n DW2/Initializer/random_normal (0/0 params, 0/0 flops, 0B/0B, Add)\n DW2/Initializer/random_normal/RandomStandardNormal (0/0 params, 0/0 flops, 0B/0B, RandomStandardNormal)\n DW2/Initializer/random_normal/mean (0/0 params, 0/0 flops, 0B/0B, Const)\n DW2/Initializer/random_normal/mul (0/0 params, 0/0 flops, 0B/0B, Mul)\n DW2/Initializer/random_normal/shape (0/0 params, 0/0 flops, 0B/0B, Const)\n DW2/Initializer/random_normal/stddev (0/0 params, 0/0 flops, 0B/0B, Const)\n DW2/read (0/0 params, 0/0 flops, 1.15KB/1.15KB, /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/cpu:0|Identity)\n ScalarW (1, 1/1 params, 0/0 flops, 0B/0B, VariableV2|_trainable_variables)\n ScalarW/Assign (0/0 params, 0/0 flops, 0B/0B, Assign)\n ScalarW/Initializer (0/0 params, 0/0 flops, 0B/0B, _kTFScopeParent)\n ScalarW/Initializer/random_normal (0/0 params, 0/0 flops, 0B/0B, Add)\n ScalarW/Initializer/random_normal/RandomStandardNormal (0/0 params, 0/0 flops, 0B/0B, RandomStandardNormal)\n ScalarW/Initializer/random_normal/mean (0/0 params, 0/0 flops, 0B/0B, Const)\n ScalarW/Initializer/random_normal/mul (0/0 params, 0/0 flops, 0B/0B, Mul)\n ScalarW/Initializer/random_normal/shape (0/0 params, 0/0 flops, 0B/0B, Const)\n ScalarW/Initializer/random_normal/stddev (0/0 params, 0/0 flops, 0B/0B, Const)\n ScalarW/read (0/0 params, 0/0 flops, 0B/0B, Identity)\n init (0/0 params, 0/0 flops, 0B/0B, NoOp)\n zeros (0/0 params, 0/0 flops, 864B/864B, /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/cpu:0|Const)\n',
7979
f.read())
8080
# pylint: enable=line-too-long
8181

8282
def testSimpleCodeView(self):
8383
ops.reset_default_graph()
8484
opts = model_analyzer.TRAINABLE_VARS_PARAMS_STAT_OPTIONS.copy()
85-
opts['dump_to_file'] = os.path.join(test.get_temp_dir(), 'dump')
85+
outfile = os.path.join(test.get_temp_dir(), 'dump')
86+
opts['output'] = 'file:outfile=' + outfile
8687
opts['account_type_regexes'] = ['.*']
8788
opts['show_name_regexes'] = ['.*model_analyzer_testlib.*']
8889
opts['account_displayed_op_only'] = False
@@ -92,9 +93,7 @@ def testSimpleCodeView(self):
9293
'bytes', 'params', 'float_ops', 'num_hidden_ops', 'device',
9394
]
9495

95-
config = config_pb2.ConfigProto(
96-
graph_options=config_pb2.GraphOptions(build_cost_model=1))
97-
with session.Session(config=config) as sess, ops.device('/cpu:0'):
96+
with session.Session() as sess, ops.device('/cpu:0'):
9897
x = lib.BuildSmallModel()
9998

10099
sess.run(variables.global_variables_initializer())
@@ -107,7 +106,7 @@ def testSimpleCodeView(self):
107106
model_analyzer.print_model_analysis(
108107
sess.graph, run_meta, tfprof_cmd='code', tfprof_options=opts)
109108

110-
with gfile.Open(opts['dump_to_file'], 'r') as f:
109+
with gfile.Open(outfile, 'r') as f:
111110
# pylint: disable=line-too-long
112111
self.assertEqual(
113112
'_TFProfRoot (0/451 params, 0/10.44k flops, 0B/5.28KB)\n model_analyzer_testlib.py:33:BuildSmallModel:image = array_ops... (0/0 params, 0/0 flops, 0B/864B)\n model_analyzer_testlib.py:37:BuildSmallModel:initializer=init_... (0/1 params, 0/0 flops, 0B/0B)\n model_analyzer_testlib.py:41:BuildSmallModel:initializer=init_... (0/162 params, 0/0 flops, 0B/1.30KB)\n model_analyzer_testlib.py:42:BuildSmallModel:x = nn_ops.conv2d... (0/0 params, 0/5.83k flops, 0B/432B)\n model_analyzer_testlib.py:46:BuildSmallModel:initializer=init_... (0/288 params, 0/0 flops, 0B/2.30KB)\n model_analyzer_testlib.py:47:BuildSmallModel:x = nn_ops.conv2d... (0/0 params, 0/4.61k flops, 0B/384B)\n',
@@ -117,15 +116,14 @@ def testSimpleCodeView(self):
117116
def testComplexCodeView(self):
118117
ops.reset_default_graph()
119118
opts = model_analyzer.TRAINABLE_VARS_PARAMS_STAT_OPTIONS.copy()
120-
opts['dump_to_file'] = os.path.join(test.get_temp_dir(), 'dump')
119+
outfile = os.path.join(test.get_temp_dir(), 'dump')
120+
opts['output'] = 'file:outfile=' + outfile
121121
opts['account_type_regexes'] = ['.*']
122122
opts['show_name_regexes'] = ['.*model_analyzer_testlib.py.*']
123123
opts['account_displayed_op_only'] = False
124124
opts['select'] = ['params', 'float_ops']
125125

126-
config = config_pb2.ConfigProto(
127-
graph_options=config_pb2.GraphOptions(build_cost_model=1))
128-
with session.Session(config=config) as sess, ops.device('/cpu:0'):
126+
with session.Session() as sess, ops.device('/cpu:0'):
129127
x = lib.BuildFullModel()
130128

131129
sess.run(variables.global_variables_initializer())
@@ -139,7 +137,7 @@ def testComplexCodeView(self):
139137
sess.graph, run_meta, tfprof_cmd='code', tfprof_options=opts)
140138

141139
# pylint: disable=line-too-long
142-
with gfile.Open(opts['dump_to_file'], 'r') as f:
140+
with gfile.Open(outfile, 'r') as f:
143141
self.assertEqual(
144142
'_TFProfRoot (0/2.84k params, 0/54.08k flops)\n model_analyzer_testlib.py:56:BuildFullModel:seq.append(array_... (0/1.80k params, 0/41.76k flops)\n model_analyzer_testlib.py:33:BuildSmallModel:image = array_ops... (0/0 params, 0/0 flops)\n model_analyzer_testlib.py:37:BuildSmallModel:initializer=init_... (0/4 params, 0/0 flops)\n model_analyzer_testlib.py:41:BuildSmallModel:initializer=init_... (0/648 params, 0/0 flops)\n model_analyzer_testlib.py:42:BuildSmallModel:x = nn_ops.conv2d... (0/0 params, 0/23.33k flops)\n model_analyzer_testlib.py:46:BuildSmallModel:initializer=init_... (0/1.15k params, 0/0 flops)\n model_analyzer_testlib.py:47:BuildSmallModel:x = nn_ops.conv2d... (0/0 params, 0/18.43k flops)\n model_analyzer_testlib.py:60:BuildFullModel:cell, array_ops.c... (0/1.04k params, 0/4.13k flops)\n model_analyzer_testlib.py:62:BuildFullModel:target = array_op... (0/0 params, 0/0 flops)\n model_analyzer_testlib.py:63:BuildFullModel:loss = nn_ops.l2_... (0/0 params, 0/0 flops)\n model_analyzer_testlib.py:65:BuildFullModel:return sgd_op.min... (0/0 params, 0/8.19k flops)\n',
145143
f.read())
@@ -170,9 +168,7 @@ def testCodeViewLeafGraphNode(self):
170168
'bytes', 'params', 'float_ops', 'num_hidden_ops', 'device'
171169
]
172170

173-
config = config_pb2.ConfigProto(
174-
graph_options=config_pb2.GraphOptions(build_cost_model=1))
175-
with session.Session(config=config) as sess, ops.device('/cpu:0'):
171+
with session.Session() as sess, ops.device('/cpu:0'):
176172
x = lib.BuildSmallModel()
177173

178174
sess.run(variables.global_variables_initializer())

tensorflow/contrib/tfprof/python/tools/tfprof/print_model_analysis_test.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
'hide_name_regexes': [],
5252
'account_displayed_op_only': True,
5353
'select': ['params'],
54-
'viz': False
54+
'output': 'stdout',
5555
}
5656

5757
# pylint: enable=bad-whitespace
@@ -92,7 +92,7 @@ def testPrintModelAnalysis(self):
9292
opts.account_displayed_op_only = TEST_OPTIONS['account_displayed_op_only']
9393
for p in TEST_OPTIONS['select']:
9494
opts.select.append(p)
95-
opts.viz = TEST_OPTIONS['viz']
95+
opts.output = TEST_OPTIONS['output']
9696

9797
with session.Session() as sess, ops.device('/cpu:0'):
9898
_ = self._BuildSmallModel()
@@ -116,7 +116,6 @@ def testPrintModelAnalysis(self):
116116
total_exec_micros: 0
117117
total_requested_bytes: 0
118118
total_parameters: 0
119-
device: "/device:CPU:0"
120119
float_ops: 0
121120
total_float_ops: 0
122121
}
@@ -128,15 +127,13 @@ def testPrintModelAnalysis(self):
128127
total_exec_micros: 0
129128
total_requested_bytes: 0
130129
total_parameters: 648
131-
device: "/device:CPU:0"
132130
children {
133131
name: "DW/Assign"
134132
exec_micros: 0
135133
requested_bytes: 0
136134
total_exec_micros: 0
137135
total_requested_bytes: 0
138136
total_parameters: 0
139-
device: "/device:CPU:0"
140137
float_ops: 0
141138
total_float_ops: 0
142139
}
@@ -217,7 +214,6 @@ def testPrintModelAnalysis(self):
217214
total_exec_micros: 0
218215
total_requested_bytes: 0
219216
total_parameters: 0
220-
device: "/device:CPU:0"
221217
float_ops: 0
222218
total_float_ops: 0
223219
}
@@ -231,7 +227,6 @@ def testPrintModelAnalysis(self):
231227
total_exec_micros: 0
232228
total_requested_bytes: 0
233229
total_parameters: 0
234-
device: "/device:CPU:0"
235230
float_ops: 0
236231
total_float_ops: 0
237232
}

0 commit comments

Comments
 (0)
0