code: def __init__(self, d_embed: int):
      super(SinusoidalPositionalEmbedding, self).__init__()
      if d_embed % 2 > 0:
          raise ValueError(
              "sinusoidal embedding must have an even dimension"
          )
      self.d_embed = d_embed
      inv_freq = pt.arange(0, self.d_embed, 2, dtype=pt.float)
      inv_freq /= self.d_embed
      inv_freq *= -math.log(1e4)
      self.register_buffer("inv_freq", inv_freq.exp_())
  
file_path: gluonts/src/gluonts/nursery/daf/tslib/nn/attention/posemb.py
imports: from typing import Optional, List, Tuple
  from functools import reduce
  from operator import mul, add
  import math
  import torch
  from torch import Tensor, LongTensor
  from torch import nn
  from torch.nn import init
label_desc: Use image node_id 1 to create a new SinusoidalPositionalEmbedding object from inherited base classes: nn with example: obj = SinusoidalPositionalEmbedding(d_embed)