code: def _gaussian_kernel_2d(
      channel: int,
      kernel_size: Sequence[int],
      sigma: Sequence[float],
      dtype: torch.dtype,
      device: Union[torch.device, str],
  ) -> Tensor:
      """Compute 2D gaussian kernel.
  
      Args:
          channel: number of channels in the image
          kernel_size: size of the gaussian kernel as a tuple (h, w)
          sigma: Standard deviation of the gaussian kernel
          dtype: data type of the output tensor
          device: device of the output tensor
  
      Example:
          >>> _gaussian_kernel_2d(1, (5,5), (1,1), torch.float, "cpu")
          tensor([[[[0.0030, 0.0133, 0.0219, 0.0133, 0.0030],
                    [0.0133, 0.0596, 0.0983, 0.0596, 0.0133],
                    [0.0219, 0.0983, 0.1621, 0.0983, 0.0219],
                    [0.0133, 0.0596, 0.0983, 0.0596, 0.0133],
                    [0.0030, 0.0133, 0.0219, 0.0133, 0.0030]]]])
  
      """
      gaussian_kernel_x = _gaussian(
          kernel_size[0], sigma[0], dtype, device
      )
      gaussian_kernel_y = _gaussian(
          kernel_size[1], sigma[1], dtype, device
      )
      kernel = torch.matmul(
          gaussian_kernel_x.t(), gaussian_kernel_y
      )  # (kernel_size, 1) * (1, kernel_size)
  
      return kernel.expand(channel, 1, kernel_size[0], kernel_size[1])
  
file_path: torchmetrics/src/torchmetrics/functional/image/helper.py
imports: from typing import Sequence, Tuple, Union
  import torch
  from torch import Tensor
  from torch.nn import functional
label_desc: Use image node_id 2 for calling a global function with example usage: _gaussian_kernel_2d(channel, kernel_size, sigma, dtype, device) and returns: kernel