From 455a567053b97fc45ab2478a013da56e8cd7c8ea Mon Sep 17 00:00:00 2001 From: Emily Dinan Date: Fri, 19 Mar 2021 12:56:06 -0400 Subject: [PATCH] label vec to text vec (#3541) --- parlai/core/torch_generator_agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parlai/core/torch_generator_agent.py b/parlai/core/torch_generator_agent.py index 6fb5dbe0b3a..ae92d48964d 100644 --- a/parlai/core/torch_generator_agent.py +++ b/parlai/core/torch_generator_agent.py @@ -844,7 +844,7 @@ def rank_eval_label_candidates(self, batch, batchsize): num_cands = len(batch.candidate_vecs[i]) enc = self.model.reorder_encoder_states(encoder_states, [i] * num_cands) cands, _ = self._pad_tensor(batch.candidate_vecs[i]) - cands = cands.to(batch.label_vec.device) + cands = cands.to(batch.text_vec.device) scores, _ = self.model.decode_forced(enc, cands) score_view = scores.reshape(num_cands * cands.size(1), -1) cand_losses = F.cross_entropy(