Check that op_fetches have valid ops.
(self, op_fetches)
| 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.""" |
no test coverage detected