MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / add_node

Method add_node

python/paddle/distributed/auto_parallel/static/graph.py:118–129  ·  view source on GitHub ↗
(self, node_id, **attrs)

Source from the content-addressed store, hash-verified

116 return self._adjs
117
118 def add_node(self, node_id, **attrs):
119 if node_id is None:
120 raise ValueError("None cannot be a node")
121 if node_id not in self._nodes:
122 node = Node(node_id, **attrs)
123 self._nodes[node_id] = node
124 self._adjs[node_id] = {}
125 self._reverse_adjs[node_id] = []
126 else:
127 self._nodes[node_id].attrs.update(attrs)
128
129 return self._nodes[node_id]
130
131 def add_edge(self, src_id, tgt_id, **attrs):
132 # add nodes

Callers 10

build_process_graphFunction · 0.95
build_cluster_graphFunction · 0.95
convert_to_graphMethod · 0.95
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45

Calls 3

ValueErrorClass · 0.85
NodeClass · 0.70
updateMethod · 0.45

Tested by

no test coverage detected