code: def forward(self, timesteps):
      dim = self.dim
      half = dim // 2
      max_period = self.max_period
      dtype = timesteps.dtype
      freqs = torch.exp(
          -math.log(max_period)
          * torch.arange(start=0, end=half, dtype=torch.float32)
          / half
      ).to(device=timesteps.device)
      args = timesteps[:, None].float() * freqs[None]
      args = args.to(dtype=dtype)
      embedding = torch.cat([torch.cos(args), torch.sin(args)], dim=-1)
      if dim % 2:
          embedding = torch.cat(
              [embedding, torch.zeros_like(embedding[:, :1])], dim=-1
          )
      return embedding
  
file_path: NeMo/nemo/collections/multimodal/modules/imagen/diffusionmodules/embs.py
imports: import math
  import torch
  import torch.nn
  from einops import rearrange
label_desc: Use image node_id 2 for calling the UnLearnedSinusoidalPosEmb obj's underlying member method code with example usage: obj.forward(timesteps) and returns: embedding