mirror of
https://github.com/deepseek-ai/DeepSeek-V3.git
synced 2025-04-19 10:08:59 -04:00
NoneType check
self.experts has None values for non-local experts. This will cause NoneType object is not callable.
This commit is contained in:
parent
592fd5daf8
commit
3421621d7b
@ -679,7 +679,7 @@ class MoE(nn.Module):
|
|||||||
y = torch.zeros_like(x)
|
y = torch.zeros_like(x)
|
||||||
counts = torch.bincount(indices.flatten(), minlength=self.n_routed_experts).tolist()
|
counts = torch.bincount(indices.flatten(), minlength=self.n_routed_experts).tolist()
|
||||||
for i in range(self.experts_start_idx, self.experts_end_idx):
|
for i in range(self.experts_start_idx, self.experts_end_idx):
|
||||||
if counts[i] == 0:
|
if counts[i] == 0 or self.experts[i] is None:
|
||||||
continue
|
continue
|
||||||
expert = self.experts[i]
|
expert = self.experts[i]
|
||||||
idx, top = torch.where(indices == i)
|
idx, top = torch.where(indices == i)
|
||||||
|
Loading…
Reference in New Issue
Block a user