(self, vocab: Vocab, padding_idx: int = 1, freeze: bool = True,
                 permuting: bool = True, tracking: bool = True)
Instantiating Embedding class

        Args:
            vocab (model.utils.Vocab): the instance of model.utils.Vocab
            padding_idx (int): denote padding_idx to padding token
            freeze (bool): freezing weights. Default: False
            permuting (bool): permuting (n, l, c) -> (n, c, l). Default: True
            tracking (bool): tracking length of sequence. Default: True
Instantiating Embedding class
Instantiating Embedding class
def __init__(self, vocab: Vocab, padding_idx: int = 1, freeze: bool = True,
                 permuting: bool = True, tracking: bool = True) -> None:
        """Instantiating Embedding class

        Args:
            vocab (model.utils.Vocab): the instance of model.utils.Vocab
            padding_idx (int): denote padding_idx to padding token
            freeze (bool): freezing weights. Default: False
            permuting (bool): permuting (n, l, c) -> (n, c, l). Default: True
            tracking (bool): tracking length of sequence. Default: True
        """
        super(Embedding, self).__init__()
        self._padding_idx = padding_idx
        self._permuting = permuting
        self._tracking = tracking
        self._ops = nn.Embedding.from_pretrained(torch.from_numpy(vocab.embedding),
                                                 freeze=freeze, padding_idx=self._padding_idx)
def __init__ ( self , vocab : Vocab , padding_idx : int = 1 , freeze : bool = True , permuting : bool = True , tracking : bool = True ) -> None : super ( Embedding , self ) . __init__ ( ) self . _padding_idx = padding_idx self . _permuting = permuting self . _tracking = tracking self . _ops = nn . Embedding . from_pretrained ( torch . from_numpy ( vocab . embedding ) , freeze = freeze , padding_idx = self . _padding_idx )