(self, num_experts: int, in_features: int, out_features: int)
| 5747 | """Model using SwitchLinear for expert selection + matmul.""" |
| 5748 | |
| 5749 | def __init__(self, num_experts: int, in_features: int, out_features: int): |
| 5750 | super().__init__() |
| 5751 | from executorch.backends.mlx.llm.switch import SwitchLinear |
| 5752 | |
| 5753 | self.switch = SwitchLinear(in_features, out_features, num_experts) |
| 5754 | self.switch.pack() |
| 5755 | |
| 5756 | def forward(self, x: torch.Tensor, indices: torch.Tensor) -> torch.Tensor: |
| 5757 | return self.switch(x, indices) |
nothing calls this directly
no test coverage detected