code: def sinusoidal_embedding(n_channels, dim):
      pe = torch.FloatTensor(
          [
              [p / (10000 ** (2 * (i // 2) / dim)) for i in range(dim)]
              for p in range(n_channels)
          ]
      )
      pe[:, 0::2] = torch.sin(pe[:, 0::2])
      pe[:, 1::2] = torch.cos(pe[:, 1::2])
      return rearrange(pe, "... -> 1 ...")
  
imports: import torch
  from torch import nn, einsum
  import torch.nn.functional
  from einops import rearrange, repeat
label_desc: Use image node_id 12 for calling a global function with example usage: sinusoidal_embedding(n_channels, dim) and returns: rearrange