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)
| 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. |