Returns names of the ops that `op` should be colocated with.
(op)
| 288 | |
| 289 | |
| 290 | def _GetColocationNames(op): |
| 291 | """Returns names of the ops that `op` should be colocated with.""" |
| 292 | colocation_names = [] |
| 293 | try: |
| 294 | class_values = op.get_attr('_class') |
| 295 | except ValueError: |
| 296 | # No _class attr |
| 297 | return |
| 298 | for val in class_values: |
| 299 | val = compat.as_str(val) |
| 300 | if val.startswith('loc:@'): |
| 301 | colocation_node_name = val[len('loc:@'):] |
| 302 | if colocation_node_name != op.name: |
| 303 | colocation_names.append(colocation_node_name) |
| 304 | return colocation_names |
| 305 | |
| 306 | |
| 307 | def _GatherReturnElements(requested_return_elements, graph, results): |
no test coverage detected