code: def constant_std_init_(tensor, sampler_):
      assert hasattr(
          tensor, "infshape"
      ), "Please call set_base_shapes(...)"
      if tensor.infshape.ninf() <= 1:
          sampler_(tensor)
      elif tensor.infshape.ninf() == 2:
          sampler_(tensor, scale=tensor.infshape.width_mult() ** -0.5)
      else:
          raise NotImplementedError()
      return tensor
  
file_path: NeMo/nemo/collections/nlp/modules/common/megatron/mup/init.py
imports: import math
  import warnings
  import torch
  from torch.nn.init import _calculate_correct_fan, _calculate_fan_in_and_fan_out, _no_grad_fill_, _no_grad_normal_, _no_grad_uniform_, calculate_gain
label_desc: Use image node_id 1 for calling a global function with example usage: constant_std_init_(tensor, sampler_) and returns: tensor