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

Method _process_op_fetches

tensorflow/python/tpu/tensor_tracer.py:1136–1153  ·  view source on GitHub ↗

Check that op_fetches have valid ops.

(self, op_fetches)

Source from the content-addressed store, hash-verified

1134 return fetches
1135
1136 def _process_op_fetches(self, op_fetches):
1137 """Check that op_fetches have valid ops."""
1138 if op_fetches is None:
1139 return []
1140
1141 if not isinstance(op_fetches, (list, tuple)):
1142 op_fetches = [op_fetches]
1143
1144 fetches = []
1145 for fetch in op_fetches:
1146 if isinstance(fetch, ops.Operation):
1147 fetches.append(fetch)
1148 elif isinstance(fetch, ops.Tensor):
1149 fetches.append(fetch.op)
1150 else:
1151 logging.warning('Ignoring the given op_fetch:%s, which is not an op.' %
1152 fetch)
1153 return fetches
1154
1155 def _convert_fetches_to_input_format(self, input_fetches, current_fetches):
1156 """Changes current_fetches' format, so that it matches input_fetches."""

Callers 1

_trace_executionMethod · 0.95

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected