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

Method add_step

tensorflow/python/profiler/model_analyzer.py:189–205  ·  view source on GitHub ↗

Add statistics of a step. Args: step: int, An id used to group one or more different `run_meta` together. When profiling with the profile_xxx APIs, user can use the `step` id in the `options` to profile these `run_meta` together. run_meta: RunMetadata proto that

(self, step, run_meta)

Source from the content-addressed store, hash-verified

187 print_mdl.DeleteProfiler()
188
189 def add_step(self, step, run_meta):
190 """Add statistics of a step.
191
192 Args:
193 step: int, An id used to group one or more different `run_meta` together.
194 When profiling with the profile_xxx APIs, user can use the `step`
195 id in the `options` to profile these `run_meta` together.
196 run_meta: RunMetadata proto that contains statistics of a session run.
197 """
198 # pylint: disable=protected-access
199 op_log = tfprof_logger.merge_default_with_oplog(
200 self._graph, run_meta=run_meta)
201 # pylint: enable=protected-access
202 # TODO(xpan): P1: Better to find the current graph.
203 self._coverage = print_mdl.AddStep(step, _graph_string(self._graph),
204 run_meta.SerializeToString(),
205 op_log.SerializeToString())
206
207 def profile_python(self, options):
208 """Profile the statistics of the Python codes.

Callers 5

testProfileBasicMethod · 0.95
testMultiStepProfileMethod · 0.95
_profiled_runFunction · 0.80
RetrieveLogsMethod · 0.80

Calls 3

_graph_stringFunction · 0.85
AddStepMethod · 0.80
SerializeToStringMethod · 0.45

Tested by 3

testProfileBasicMethod · 0.76
testMultiStepProfileMethod · 0.76