i think the problem is with embedding layer there are not in correct shape
        output = self.embedding(input)


like these i removed the .view(1,1,-1) in the encoder,decoder and attentiondecoder class may be due to that its showing such kind of error @ptrblck