code: def _gaussian(
      kernel_size: int,
      sigma: float,
      dtype: torch.dtype,
      device: Union[torch.device, str],
  ) -> Tensor:
      """Compute 1D gaussian kernel.
  
      Args:
          kernel_size: size of the gaussian kernel
          sigma: Standard deviation of the gaussian kernel
          dtype: data type of the output tensor
          device: device of the output tensor
  
      Example:
          >>> _gaussian(3, 1, torch.float, 'cpu')
          tensor([[0.2741, 0.4519, 0.2741]])
  
      """
      dist = torch.arange(
          start=(1 - kernel_size) / 2,
          end=(1 + kernel_size) / 2,
          step=1,
          dtype=dtype,
          device=device,
      )
      gauss = torch.exp(-torch.pow(dist / sigma, 2) / 2)
      return (gauss / gauss.sum()).unsqueeze(dim=0)
  
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 1 for calling a global function with example usage: _gaussian(kernel_size, sigma, dtype, device) and returns: unknown