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 __init__(self, dim):
      super().__init__()
      assert (dim % 2) == 0
      half_dim = dim // 2
      self.weights = nn.Parameter(torch.randn(half_dim))
  
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 1 to create a new LearnedSinusoidalPosEmb object from inherited base classes: nn with example: obj = LearnedSinusoidalPosEmb(dim)