- new_c_quizzes = torch.cat(kept, dim=0)
- new_c_quizzes = new_c_quizzes[
- torch.randperm(new_c_quizzes.size(0))[: nb_for_train + nb_for_test]
- ]
+ # concatenate and shuffle
+ for n in recorded.keys():
+ if len(recorded[n]) > 0:
+ q = torch.cat(recorded[n], dim=0)
+ q = q[torch.randperm(q.size(0), device=q.device)]
+ recorded[n] = q
+ else:
+ del recorded[n]
+
+ new_c_quizzes = recorded[args.nb_correct_to_validate][: nb_for_train + nb_for_test]