Gets the input op nodes for 'node'. Args: node: The node. graph: The graph containing the node. Returns: The unique input nodes.
(node, graph)
| 363 | |
| 364 | |
| 365 | def _sources_for_node(node, graph): |
| 366 | """Gets the input op nodes for 'node'. |
| 367 | |
| 368 | Args: |
| 369 | node: The node. |
| 370 | graph: The graph containing the node. |
| 371 | |
| 372 | Returns: |
| 373 | The unique input nodes. |
| 374 | """ |
| 375 | inputs = set() |
| 376 | for name in node.node_def.input: |
| 377 | if name.startswith("^"): |
| 378 | name = name[1:] |
| 379 | try: |
| 380 | tensor = graph.get_tensor_by_name(name) |
| 381 | op = tensor.op |
| 382 | except (KeyError, ValueError): |
| 383 | try: |
| 384 | op = graph.get_operation_by_name(name) |
| 385 | except KeyError: |
| 386 | continue |
| 387 | inputs.add(op) |
| 388 | |
| 389 | return list(inputs) |
| 390 | |
| 391 | |
| 392 | def _build_error_message(op, input_ops, common_prefix): |
no test coverage detected