def __init__(self, n_position: int, embedding_dim: int) -> None:
    super(SineOffsetEmbedder, self).__init__()
    self._n_position = n_position
    self._embedding_dim = embedding_dim
    self._embedding = torch.nn.Embedding(((2 * n_position) + 1), embedding_dim, padding_idx=0)
    self._embedding.weight.data = position_encoding_init(((2 * n_position) + 1), embedding_dim)
def __init__(self, n_position: int, embedding_dim: int) -> None:
    super(SineOffsetEmbedder, self).__init__()
    self._n_position = n_position
    self._embedding_dim = embedding_dim
    self._embedding = torch.nn.Embedding(((2 * n_position) + 1), embedding_dim, padding_idx=0)
    self._embedding.weight.data = position_encoding_init(((2 * n_position) + 1), embedding_dim)