MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / testPerStepTrace

Method testPerStepTrace

tensorflow/python/client/session_test.py:1673–1692  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1671 sess.run(a, feed_dict={'a': [2.0]})
1672
1673 def testPerStepTrace(self):
1674 run_options = config_pb2.RunOptions(
1675 trace_level=config_pb2.RunOptions.FULL_TRACE)
1676 run_metadata = config_pb2.RunMetadata()
1677
1678 with ops.device('/cpu:0'):
1679 with session.Session() as sess:
1680 sess.run(constant_op.constant(1.0))
1681 self.assertTrue(not run_metadata.HasField('step_stats'))
1682
1683 sess.run(constant_op.constant(1.0), run_metadata=run_metadata)
1684 self.assertTrue(not run_metadata.HasField('step_stats'))
1685
1686 sess.run(
1687 constant_op.constant(1.0),
1688 options=run_options,
1689 run_metadata=run_metadata)
1690
1691 self.assertTrue(run_metadata.HasField('step_stats'))
1692 self.assertEquals(len(run_metadata.step_stats.dev_stats), 1)
1693
1694 def testRunOptionsRunMetadata(self):
1695 run_options = config_pb2.RunOptions(

Callers

nothing calls this directly

Calls 6

RunMetadataMethod · 0.80
assertEqualsMethod · 0.80
deviceMethod · 0.45
SessionMethod · 0.45
runMethod · 0.45
constantMethod · 0.45

Tested by

no test coverage detected