Profile the statistics of graph nodes, organized by dataflow graph. Args: options: A dict of options. See core/profiler/g3doc/options.md. Returns: a GraphNodeProto that records the results.
(self, options)
| 260 | return tfprof_node |
| 261 | |
| 262 | def profile_graph(self, options): |
| 263 | """Profile the statistics of graph nodes, organized by dataflow graph. |
| 264 | |
| 265 | Args: |
| 266 | options: A dict of options. See core/profiler/g3doc/options.md. |
| 267 | Returns: |
| 268 | a GraphNodeProto that records the results. |
| 269 | """ |
| 270 | opts = _build_options(options) |
| 271 | tfprof_node = tfprof_output_pb2.GraphNodeProto() |
| 272 | try: |
| 273 | tfprof_node.ParseFromString( |
| 274 | print_mdl.Profile('graph'.encode('utf-8'), opts.SerializeToString())) |
| 275 | except message.DecodeError as e: |
| 276 | sys.stderr.write('Cannot parse returned proto: %s.\n' % e) |
| 277 | return tfprof_node |
| 278 | |
| 279 | def advise(self, options): |
| 280 | """Automatically detect problems and generate reports. |