code: def get_sinusoid_encoding(n_position, feat_dim, wave_length=10000):
      # [n_position]
      positions = paddle.arange(0, n_position)
      # [feat_dim]
      dim_range = paddle.arange(0, feat_dim)
      dim_range = paddle.pow(
          wave_length, 2 * (dim_range // 2) / feat_dim
      )
      # [n_position, feat_dim]
      angles = paddle.unsqueeze(positions, axis=1) / paddle.unsqueeze(
          dim_range, axis=0
      )
      angles = paddle.cast(angles, "float32")
      angles[:, 0::2] = paddle.sin(angles[:, 0::2])
      angles[:, 1::2] = paddle.cos(angles[:, 1::2])
      return angles
  
file_path: PaddleOCR/ppocr/modeling/backbones/rec_resnet_aster.py
imports: import paddle
  import paddle.nn
  import sys
  import math
label_desc: Use image node_id 3 for calling a global function with example usage: get_sinusoid_encoding(n_position, feat_dim, wave_length) and returns: angles