code: def init_variance_scaling_constant(tensor, scale=1.0):
      if tensor.ndim == 1:
          s = scale / np.sqrt(tensor.shape[0])
      else:
          fan_in = torch.nn.init._calculate_correct_fan(
              tensor, "fan_in"
          )
          s = scale / np.sqrt(fan_in)
      with torch.no_grad():
          return tensor.fill_(s)
  
file_path: pfrl/pfrl/nn/noisy_linear.py
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling a global function with example usage: init_variance_scaling_constant(tensor, scale) and returns: tensor