nb_to_generate_per_iteration,
model_for_generation=model,
procedure=c_quizzes_procedure,
- # to_recycle=to_recycle,
+ to_recycle=to_recycle,
)
# We discard the trivial ones, according to a criterion
###############################################################
- def generate_c_quizzes(self, nb, model_for_generation, procedure):
+ def generate_c_quizzes(self, nb, model_for_generation, procedure, to_recycle=None):
seq_logproba = torch.zeros(nb, device=self.device)
c_quizzes = None
logit_transformer=t,
)
+ if to_recycle is not None:
+ to_recycle = self.problem.reconfigure(to_recycle, s)
+ c_quizzes[: to_recycle.size(0)] = to_recycle
+ to_recycle = None
+
c_quizzes = self.problem.reconfigure(c_quizzes, ("A", "f_A", "B", "f_B"))
return c_quizzes.to("cpu")