class_docstr: following @crowsonkb 's lead with learned sinusoidal pos emb 
class_docstr_tok: ["following","@","crowsonkb","'s","lead","with","learned","sinusoidal","pos","emb"]
code: def forward(self, x):
      x = rearrange(x, "b -> b 1")
      freqs = x * rearrange(self.weights, "d -> 1 d") * 2 * math.pi
      fouriered = torch.cat((freqs.sin(), freqs.cos()), dim=-1)
      fouriered = torch.cat((x, fouriered), dim=-1)
      return fouriered
  
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 LearnedSinusoidalPosEmb obj's underlying member method code with example usage: obj.forward(x) and returns: fouriered