code: def variance_scaling_(
      tensor, scale=1.0, mode="fan_in", distribution="normal"
  ):
      fan_in, fan_out = _calculate_fan_in_and_fan_out(tensor)
      if mode == "fan_in":
          denom = fan_in
      elif mode == "fan_out":
          denom = fan_out
      elif mode == "fan_avg":
          denom = (fan_in + fan_out) / 2
  
      variance = scale / denom
  
      if distribution == "truncated_normal":
          # constant is stddev of standard normal truncated to (-2, 2)
          trunc_normal_tf_(
              tensor, std=math.sqrt(variance) / 0.87962566103423978
          )
      elif distribution == "normal":
          with torch.no_grad():
              tensor.normal_(std=math.sqrt(variance))
      elif distribution == "uniform":
          bound = math.sqrt(3 * variance)
          with torch.no_grad():
              tensor.uniform_(-bound, bound)
      else:
          raise ValueError(f"invalid distribution {distribution}")
  
file_path: pytorch-image-models/timm/layers/weight_init.py
imports: import torch
  import math
  import warnings
  from torch.nn.init import _calculate_fan_in_and_fan_out
label_desc: Use image node_id 4 for calling a global function with example usage: variance_scaling_(tensor, scale, mode, distribution) without return types