mirror of
https://github.com/labmlai/annotated_deep_learning_paper_implementations.git
synced 2025-11-01 03:43:09 +08:00
shuffle
This commit is contained in:
@ -110,6 +110,7 @@ class SwitchFeedForward(Module):
|
||||
for i in range(self.n_switches):
|
||||
if len(indexes_list[i]) <= capacity:
|
||||
continue
|
||||
indexes_list[i] = indexes_list[i][torch.randperm(len(indexes_list[i]))]
|
||||
dropped.append(indexes_list[i][capacity:])
|
||||
indexes_list[i] = indexes_list[i][:capacity]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user