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

Method define_node

backends/apple/mps/operators/shape_ops.py:154–162  ·  view source on GitHub ↗
(
        self,
        node: torch.fx.Node,
        mps_graph: MPSGraph,
    )

Source from the content-addressed store, hash-verified

152 super().__init__(*args)
153
154 def define_node(
155 self,
156 node: torch.fx.Node,
157 mps_graph: MPSGraph,
158 ) -> None:
159 mps_node = self.create_unary_node(node, mps_graph, MPSSelect)
160 mps_node.mpsnode_union.dim = cast(int, node.args[1])
161 mps_node.mpsnode_union.index = eval_expr(cast(torch.SymInt, node.args[2]))
162 mps_graph.mps_nodes.append(mps_node)
163
164
165@register_node_visitor

Callers

nothing calls this directly

Calls 3

eval_exprFunction · 0.90
create_unary_nodeMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected