code: def _get_gaussian_kernel1d(kernel_size: int, sigma: float) -> Tensor:
      ksize_half = (kernel_size - 1) * 0.5
  
      x = torch.linspace(-ksize_half, ksize_half, steps=kernel_size)
      pdf = torch.exp(-0.5 * (x / sigma).pow(2))
      kernel1d = pdf / pdf.sum()
  
      return kernel1d
  
imports: import warnings
  from typing import List, Optional, Tuple, Union
  import torch
  from torch import Tensor
  from torch.nn.functional import conv2d, grid_sample, interpolate, pad
label_desc: Use image node_id 35 for calling a global function with example usage: _get_gaussian_kernel1d(kernel_size, sigma) and returns: kernel1d