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)
| 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() |
nothing calls this directly
no test coverage detected