code: def truncated_normal_(tensor, mean=0, std=1):
      # https://discuss.pytorch.org/t/implementing-truncated-normal-initializer/4778/15
      size = tensor.shape
      tmp = tensor.new_empty(size + (4,)).normal_()
      valid = (tmp < 2) & (tmp > -2)
      ind = valid.max(-1, keepdim=True)[1]
      tensor.data.copy_(tmp.gather(-1, ind).squeeze(-1))
      tensor.data.mul_(std).add_(mean)
  
file_path: nni/examples/nas/legacy/nasbench101/base_ops.py
imports: import math
  import torch.nn
label_desc: Use image node_id 1 for calling a global function with example usage: truncated_normal_(tensor, mean, std) without return types