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

Method profile_graph

tensorflow/python/profiler/model_analyzer.py:262–277  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 2

testProfileBasicMethod · 0.95
_profiled_runFunction · 0.80

Calls 6

_build_optionsFunction · 0.85
ParseFromStringMethod · 0.45
ProfileMethod · 0.45
encodeMethod · 0.45
SerializeToStringMethod · 0.45
writeMethod · 0.45

Tested by 1

testProfileBasicMethod · 0.76