(self, source, step=None)
return source
Computes the embeddings for words and features.

        Args:
            source (`LongTensor`): index tensor `[len x batch x nfeat]`
        Return:
            `FloatTensor`: word embeddings `[len x batch x embedding_size]`
Computes the embeddings for words and features.
Computes the embeddings for words and features .
def forward(self, source, step=None):
        """
        Computes the embeddings for words and features.

        Args:
            source (`LongTensor`): index tensor `[len x batch x nfeat]`
        Return:
            `FloatTensor`: word embeddings `[len x batch x embedding_size]`
        """
        if self.position_encoding:
            for i, module in enumerate(self.make_embedding._modules.values()):
                if i == len(self.make_embedding._modules.values()) - 1:
                    source = module(source, step=step)
                else:
                    source = module(source)
        else:
            source = self.make_embedding(source)

        return source
def forward ( self , source , step = None ) : if self . position_encoding : for i , module in enumerate ( self . make_embedding . _modules . values ( ) ) : if i == len ( self . make_embedding . _modules . values ( ) ) - 1 : source = module ( source , step = step ) else : source = module ( source ) else : source = self . make_embedding ( source ) return source