(self, input, lengths=None, hidden=None)
return emb_remap.squeeze(3).transpose(0, 1).contiguous(), \
            out.squeeze(3).transpose(0, 1).contiguous()
See :obj:`onmt.modules.EncoderBase.forward()`
See :obj:`onmt.modules.EncoderBase.forward()`
See : obj : onmt . modules . EncoderBase . forward ()
def forward(self, input, lengths=None, hidden=None):
        """ See :obj:`onmt.modules.EncoderBase.forward()`"""
        self._check_args(input, lengths, hidden)

        emb = self.embeddings(input)
        # s_len, batch, emb_dim = emb.size()

        emb = emb.transpose(0, 1).contiguous()
        emb_reshape = emb.view(emb.size(0) * emb.size(1), -1)
        emb_remap = self.linear(emb_reshape)
        emb_remap = emb_remap.view(emb.size(0), emb.size(1), -1)
        emb_remap = shape_transform(emb_remap)
        out = self.cnn(emb_remap)

        return emb_remap.squeeze(3).transpose(0, 1).contiguous(), \
            out.squeeze(3).transpose(0, 1).contiguous()
def forward ( self , input , lengths = None , hidden = None ) : self . _check_args ( input , lengths , hidden ) emb = self . embeddings ( input ) # s_len, batch, emb_dim = emb.size() emb = emb . transpose ( 0 , 1 ) . contiguous ( ) emb_reshape = emb . view ( emb . size ( 0 ) * emb . size ( 1 ) , - 1 ) emb_remap = self . linear ( emb_reshape ) emb_remap = emb_remap . view ( emb . size ( 0 ) , emb . size ( 1 ) , - 1 ) emb_remap = shape_transform ( emb_remap ) out = self . cnn ( emb_remap ) return emb_remap . squeeze ( 3 ) . transpose ( 0 , 1 ) . contiguous ( ) , out . squeeze ( 3 ) . transpose ( 0 , 1 ) . contiguous ( )