Compute the list of unique input tensors of all the op in ops. Args: ops: an object convertible to a list of `tf.Operation`. Returns: The list of unique input tensors of all the op in ops. Raises: TypeError: if ops cannot be converted to a list of `tf.Operation`.
(ops)
| 79 | |
| 80 | |
| 81 | def _get_input_ts(ops): |
| 82 | """Compute the list of unique input tensors of all the op in ops. |
| 83 | |
| 84 | Args: |
| 85 | ops: an object convertible to a list of `tf.Operation`. |
| 86 | Returns: |
| 87 | The list of unique input tensors of all the op in ops. |
| 88 | Raises: |
| 89 | TypeError: if ops cannot be converted to a list of `tf.Operation`. |
| 90 | """ |
| 91 | ops = util.make_list_of_op(ops) |
| 92 | ts = [] |
| 93 | ts_set = set() |
| 94 | for op in ops: |
| 95 | for t in op.inputs: |
| 96 | if t not in ts_set: |
| 97 | ts.append(t) |
| 98 | ts_set.add(t) |
| 99 | return ts |
| 100 | |
| 101 | |
| 102 | def _get_output_ts(ops): |
no test coverage detected