MCPcopy Create free account
hub / github.com/bitsandbytes-foundation/bitsandbytes / forward

Method forward

tests/test_parametrize.py:217–220  ·  view source on GitHub ↗
(self, x, expert_idx=0)

Source from the content-addressed store, hash-verified

215 self.expert_weights = nn.Parameter(torch.randn(4, 32, 64, dtype=dtype, device=device))
216
217 def forward(self, x, expert_idx=0):
218 # Select and use specific expert weight matrix
219 expert_weight = self.expert_weights[expert_idx] # Shape: [input_dim, output_dim]
220 return torch.matmul(x, expert_weight)
221
222 module = SimpleMoE(device=device, dtype=dtype)
223 x = torch.randn(8, 32, dtype=dtype, device=device)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected