Transformers, Pytorch, Machine Learning, Deep Dives, Data Science.
memory=memory, tgt_mask=self.generate_square_subsequent_mask(tgt.size(1)), tgt_padding_mask=tgt_padding_mask, memory_padding_mask=memory_padding_mask, ) output = self.fc(decoder_output) # shape (B, L, C) return output def forward( self, x: torch.Tensor, y: torch.Tensor, ) -> torch.Tensor: """ Input