code: def sinusoidal_init_(tensor):
      """
      tensor: (max_len, d_model)
      """
      max_len, d_model = tensor.shape
      position = rearrange(torch.arange(0.0, max_len), "s -> s 1")
      div_term = torch.exp(
          -math.log(10000.0) * torch.arange(0.0, d_model, 2.0) / d_model
      )
      tensor[:, 0::2] = torch.sin(position * div_term)
      tensor[:, 1::2] = torch.cos(position * div_term)
      return tensor
  
imports: import math
  from functools import partial
  from collections import namedtuple
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn.modules.utils import _pair
  import hydra
  from einops import reduce, rearrange
label_desc: Use image node_id 2 for calling a global function with example usage: sinusoidal_init_(tensor) and returns: tensor