(
self,
node: torch.fx.Node,
mps_graph: MPSGraph,
)
| 69 | super().__init__(*args) |
| 70 | |
| 71 | def define_node( |
| 72 | self, |
| 73 | node: torch.fx.Node, |
| 74 | mps_graph: MPSGraph, |
| 75 | ) -> None: |
| 76 | |
| 77 | input1_id = self.define_tensor(get_input_node(node, 0), mps_graph) |
| 78 | normalized_shape = eval_shape(cast(List[torch.SymInt], node.args[1])) |
| 79 | weight_id = self.define_tensor(get_input_node(node, 2), mps_graph) |
| 80 | bias_id = self.define_tensor(get_input_node(node, 3), mps_graph) |
| 81 | epsilon: float = get_scalar_val(node, 4) |
| 82 | output1_id, output2_id, output3_id = self.define_tensor_list(node, mps_graph) |
| 83 | |
| 84 | mps_graph.mps_nodes.append( |
| 85 | MPSNode( |
| 86 | mpsnode_union=MPSLayerNorm( |
| 87 | input1_id=input1_id, |
| 88 | normalized_shape=normalized_shape, |
| 89 | weight_id=weight_id, |
| 90 | bias_id=bias_id, |
| 91 | eps=epsilon, |
| 92 | output1_id=output1_id, |
| 93 | output2_id=output2_id, |
| 94 | output3_id=output3_id, |
| 95 | ) |
| 96 | ) |
| 97 | ) |
nothing calls this directly
no test coverage detected