code: def gaussian2D(radius, sigma=1, dtype=torch.float32, device="cpu"):
      """Generate 2D gaussian kernel.
  
      Args:
          radius (int): Radius of gaussian kernel.
          sigma (int): Sigma of gaussian function. Default: 1.
          dtype (torch.dtype): Dtype of gaussian tensor. Default: torch.float32.
          device (str): Device of gaussian tensor. Default: 'cpu'.
  
      Returns:
          h (Tensor): Gaussian kernel with a
              ``(2 * radius + 1) * (2 * radius + 1)`` shape.
      """
      x = torch.arange(
          -radius, radius + 1, dtype=dtype, device=device
      ).view(1, -1)
      y = torch.arange(
          -radius, radius + 1, dtype=dtype, device=device
      ).view(-1, 1)
  
      h = (-(x * x + y * y) / (2 * sigma * sigma)).exp()
  
      h[h < torch.finfo(h.dtype).eps * h.max()] = 0
      return h
  
file_path: mmdetection/mmdet/models/utils/gaussian_target.py
imports: from math import sqrt
  import torch
  import torch.nn.functional
label_desc: Use image node_id 1 for calling a global function with example usage: gaussian2D(radius, sigma, dtype, device) and returns: h