Return all the consuming ops of the tensors in ts. Args: ts: a list of `tf.Tensor` Returns: A list of all the consuming `tf.Operation` of the tensors in `ts`. Raises: TypeError: if ts cannot be converted to a list of `tf.Tensor`.
(ts)
| 176 | |
| 177 | |
| 178 | def get_consuming_ops(ts): |
| 179 | """Return all the consuming ops of the tensors in ts. |
| 180 | |
| 181 | Args: |
| 182 | ts: a list of `tf.Tensor` |
| 183 | Returns: |
| 184 | A list of all the consuming `tf.Operation` of the tensors in `ts`. |
| 185 | Raises: |
| 186 | TypeError: if ts cannot be converted to a list of `tf.Tensor`. |
| 187 | """ |
| 188 | ts = make_list_of_t(ts, allow_graph=False) |
| 189 | tops = [] |
| 190 | for t in ts: |
| 191 | for op in t.consumers(): |
| 192 | if op not in tops: |
| 193 | tops.append(op) |
| 194 | return tops |
| 195 | |
| 196 | |
| 197 | def make_list_of_op(tops, check_graph=True, allow_graph=True, ignore_ts=False): |
nothing calls this directly
no test coverage detected