MCPcopy Create free account
hub / github.com/deepdrive/deepdrive / _run_op

Function _run_op

tf_utils.py:57–73  ·  view source on GitHub ↗
(sess, op, X, x, trace=False, op_name='tf_op')

Source from the content-addressed store, hash-verified

55
56
57def _run_op(sess, op, X, x, trace=False, op_name='tf_op'):
58 start = time.time()
59 if trace:
60 run_options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE)
61 run_metadata = tf.RunMetadata()
62 ret = sess.run(op, feed_dict={X: x}, options=run_options, run_metadata=run_metadata)
63
64 # Create the Timeline object, and write it to a json
65 tl = timeline.Timeline(run_metadata.step_stats)
66 ctf = tl.generate_chrome_trace_format()
67 with open('timeline.json', 'w') as f:
68 f.write(ctf)
69 else:
70 ret = sess.run(op, feed_dict={X: x})
71 end = time.time()
72 log.debug('%r took %rms', op_name, (end - start) * 1000)
73 return ret
74
75
76def _main():

Callers 2

preprocess_imageFunction · 0.85
preprocess_depthFunction · 0.85

Calls 1

runMethod · 0.80

Tested by

no test coverage detected