code: def get_sinusoid_encoding_table(n_position, d_hid, token=False):
      """Sinusoid position encoding table"""
  
      def get_position_angle_vec(position):
          return [
              position / np.power(10000, 2 * (hid_j // 2) / d_hid)
              for hid_j in range(d_hid)
          ]
  
      sinusoid_table = np.array(
          [get_position_angle_vec(pos_i) for pos_i in range(n_position)]
      )
      sinusoid_table[:, 0::2] = np.sin(
          sinusoid_table[:, 0::2]
      )  # dim 2i
      sinusoid_table[:, 1::2] = np.cos(
          sinusoid_table[:, 1::2]
      )  # dim 2i+1
      if token:
          sinusoid_table = np.concatenate(
              [sinusoid_table, np.zeros([1, d_hid])], dim=0
          )
      return Tensor(sinusoid_table, dtype=float32).unsqueeze(0)
  
imports: import os
  import math
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.initializer import TruncatedNormal, Constant, Normal
  from paddleseg.cvlibs import manager
  from paddleseg.utils import utils, logger
  from paddleseg.models.backbones.transformer_utils import to_2tuple, DropPath, Identity
label_desc: Use image node_id 1 for calling a global function with example usage: get_sinusoid_encoding_table(n_position, d_hid, token) and returns: Tensor, unknown