Update moe.py

fixed not returning y in the forward method of MoEBlock
This commit is contained in:
Yousef R. Gamaleldin 2025-06-29 14:10:56 +03:00 committed by GitHub
parent 8ecad4cbb3
commit b445dd3af3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -152,6 +152,8 @@ class MoEBlock(nn.Module):
y = y + self.shared_experts(identity)
return y
@torch.no_grad()
def moe_infer(self, x, flat_expert_indices, flat_expert_weights):
@ -200,4 +202,4 @@ def test_moe():
print(timing)
if __name__ == "__main__":
test_moe()
test_moe()