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

Method __init__

tensorflow/python/profiler/model_analyzer.py:166–184  ·  view source on GitHub ↗

Constructor. Args: graph: tf.Graph. If None and eager execution is not enabled, use default graph. op_log: optional. tensorflow::tfprof::OpLogProto proto. Used to define extra op types.

(self, graph=None, op_log=None)

Source from the content-addressed store, hash-verified

164 """
165
166 def __init__(self, graph=None, op_log=None):
167 """Constructor.
168
169 Args:
170 graph: tf.Graph. If None and eager execution is not enabled, use
171 default graph.
172 op_log: optional. tensorflow::tfprof::OpLogProto proto. Used to define
173 extra op types.
174 """
175 if not graph and not context.executing_eagerly():
176 graph = ops.get_default_graph()
177 self._coverage = 0.0
178 self._graph = graph
179 # pylint: disable=protected-access
180 op_log = tfprof_logger.merge_default_with_oplog(
181 self._graph, op_log=op_log)
182 # pylint: enable=protected-access
183 print_mdl.NewProfiler(
184 _graph_string(self._graph), op_log.SerializeToString())
185
186 def __del__(self):
187 print_mdl.DeleteProfiler()

Callers

nothing calls this directly

Calls 3

_graph_stringFunction · 0.85
executing_eagerlyMethod · 0.80
SerializeToStringMethod · 0.45

Tested by

no test coverage detected