code: def gaussian_blur(
      img: Tensor, kernel_size: List[int], sigma: List[float]
  ) -> Tensor:
      if not (isinstance(img, torch.Tensor)):
          raise TypeError(f"img should be Tensor. Got {type(img)}")
  
      _assert_image_tensor(img)
  
      dtype = (
          img.dtype if torch.is_floating_point(img) else torch.float32
      )
      kernel = _get_gaussian_kernel2d(
          kernel_size, sigma, dtype=dtype, device=img.device
      )
      kernel = kernel.expand(
          img.shape[-3], 1, kernel.shape[0], kernel.shape[1]
      )
  
      img, need_cast, need_squeeze, out_dtype = _cast_squeeze_in(
          img, [kernel.dtype]
      )
  
      # padding = (left, right, top, bottom)
      padding = [
          kernel_size[0] // 2,
          kernel_size[0] // 2,
          kernel_size[1] // 2,
          kernel_size[1] // 2,
      ]
      img = torch_pad(img, padding, mode="reflect")
      img = conv2d(img, kernel, groups=img.shape[-3])
  
      img = _cast_squeeze_out(img, need_cast, need_squeeze, out_dtype)
      return img
  
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 37 for calling a global function with example usage: gaussian_blur(img, kernel_size, sigma) and returns: img