MCPcopy Create free account
hub / github.com/pytorch/executorch / create_shape_node

Function create_shape_node

backends/arm/_passes/arm_pass_utils.py:188–209  ·  view source on GitHub ↗

Adds a shape node to 'graph'. graph.inserting_before/after() should be used before the call to decide where to insert the node.

(
    graph: torch.fx.Graph,
    op_target: EdgeOpOverload,
    args: tuple = (),
    kwargs: Optional[dict] = None,
    from_node: Optional[torch.fx.Node] = None,
)

Source from the content-addressed store, hash-verified

186
187
188def create_shape_node(
189 graph: torch.fx.Graph,
190 op_target: EdgeOpOverload,
191 args: tuple = (),
192 kwargs: Optional[dict] = None,
193 from_node: Optional[torch.fx.Node] = None,
194):
195 """Adds a shape node to 'graph'.
196
197 graph.inserting_before/after() should be used before the call to decide
198 where to insert the node.
199
200 """
201 node = create_node(
202 graph=graph,
203 op_target=op_target,
204 args=args,
205 kwargs=kwargs,
206 from_node=from_node,
207 )
208 node.meta[TosaSpecialDtype.meta_key()] = TosaSpecialDtype.SHAPE
209 return node
210
211
212def insert_q_dq_pair(

Callers 1

callMethod · 0.90

Calls 2

meta_keyMethod · 0.80
create_nodeFunction · 0.70

Tested by

no test coverage detected