code: def __init__(self, dim, dropout_prob=0.0, max_len=1000):
      super(PositionalEncoding, self).__init__()
      pe = torch.zeros(max_len, dim).float()
      position = torch.arange(0, max_len).unsqueeze(1).float()
      dimension = torch.arange(0, dim).float()
      div_term = 10000 ** (2 * dimension / dim)
      pe[:, 0::2] = torch.sin(position / div_term[0::2])
      pe[:, 1::2] = torch.cos(position / div_term[1::2])
      self.register_buffer("pe", pe)
      self.dropout = nn.Dropout(p=dropout_prob)
      self.dim = dim
  
imports: from collections import OrderedDict
  import os
  import numpy
  import torch
  from torch import nn
  from gluoncv.torch.utils.coot_utils import truncated_normal_fill
label_desc: Use image node_id 1 to create a new PositionalEncoding object from inherited base classes: nn with example: obj = PositionalEncoding(dim, dropout_prob, max_len)