MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _sources_for_node

Function _sources_for_node

tensorflow/python/framework/error_interpolation.py:365–389  ·  view source on GitHub ↗

Gets the input op nodes for 'node'. Args: node: The node. graph: The graph containing the node. Returns: The unique input nodes.

(node, graph)

Source from the content-addressed store, hash-verified

363
364
365def _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
392def _build_error_message(op, input_ops, common_prefix):

Callers 1

interpolateFunction · 0.85

Calls 3

get_tensor_by_nameMethod · 0.80
get_operation_by_nameMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected