code: def _get_gaussian_kernel1d(
      kernel_size: int,
      sigma: float,
      dtype: torch.dtype,
      device: torch.device,
  ) -> torch.Tensor:
      lim = (kernel_size - 1) / (2.0 * math.sqrt(2.0) * sigma)
      x = torch.linspace(
          -lim, lim, steps=kernel_size, dtype=dtype, device=device
      )
      kernel1d = torch.softmax(x.pow_(2).neg_(), dim=0)
      return kernel1d
  
imports: import math
  from typing import List, Optional
  import PIL.Image
  import torch
  from torch.nn.functional import conv2d, pad
  from torchvision import tv_tensors
  from torchvision.transforms._functional_tensor import _max_value
  from torchvision.transforms.functional import pil_to_tensor, to_pil_image
  from torchvision.utils import _log_api_usage_once
  from ._utils import _get_kernel, _register_kernel_internal
label_desc: Use image node_id 5 for calling a global function with example usage: _get_gaussian_kernel1d(kernel_size, sigma, dtype, device) and returns: kernel1d