AttributeError: 'tuple' object has no attribute 'repeat ...
discuss.pytorch.org › t › attributeerror-tupleJan 09, 2022 · batch_size, beam_size = self.config.batch_size, self.config.beam_size # [1, batch_size x beam_size] dec_input = torch.ones(1, batch_size * beam_size, dtype=torch.long, device=self.device) * SOS_ID #[num_layers, batch_size * beam_size, hidden_size] #dec_hidden = dec_hidden.repeat(1, beam_size,1) if enc_outputs is not None: enc_outputs = enc_outputs.repeat(1, beam_size, 1) enc_length = enc_length.repeat(beam_size)