class_docstr: Compute GaussianBlur in 2d.
  
  Makes use of kornia functions, but most notably the kernel is not computed
  during the forward pass, and does not depend on the input size. As a caveat,
  the number of channels that are expected have to be provided during initialization.
docstr: Initialize model, setup kernel etc..
  
  Args:
      sigma (float | tuple[float, float]): standard deviation to use for constructing the Gaussian kernel.
      channels (int): channels of the input. Defaults to 1.
      kernel_size (int | tuple[int, int] | None): size of the Gaussian kernel to use. Defaults to None.
      normalize (bool, optional): Whether to normalize the kernel or not (i.e. all elements sum to 1).
          Defaults to True.
      border_type (str, optional): Border type to use for padding of the input. Defaults to "reflect".
      padding (str, optional): Type of padding to apply. Defaults to "same".
docstr_tok: ["Initialize","model",",","setup","kernel","etc","..","Args",":","sigma","(","float","|","tuple","[","float",",","float","]",")",":","standard","deviation","to","use","for","constructing","the","Gaussian","kernel",".","channels","(","int",")",":","channels","of","the","input",".","Defaults","to","1.","kernel_size","(","int","|","tuple","[","int",",","int","]","|","None",")",":","size","of","the","Gaussian","kernel","to","use",".","Defaults","to","None",".","normalize","(","bool",",","optional",")",":","Whether","to","normalize","the","kernel","or","not","(","i.e",".","all","elements","sum","to","1",")",".","Defaults","to","True",".","border_type","(","str",",","optional",")",":","Border","type","to","use","for","padding","of","the","input",".","Defaults","to","``","reflect","''",".","padding","(","str",",","optional",")",":","Type","of","padding","to","apply",".","Defaults","to","``","same","''","."]
code: def __init__(
      self,
      sigma: float | tuple[float, float],
      channels: int = 1,
      kernel_size: int | tuple[int, int] | None = None,
      normalize: bool = True,
      border_type: str = "reflect",
      padding: str = "same",
  ) -> None:
      """Initialize model, setup kernel etc..
  
      Args:
          sigma (float | tuple[float, float]): standard deviation to use for constructing the Gaussian kernel.
          channels (int): channels of the input. Defaults to 1.
          kernel_size (int | tuple[int, int] | None): size of the Gaussian kernel to use. Defaults to None.
          normalize (bool, optional): Whether to normalize the kernel or not (i.e. all elements sum to 1).
              Defaults to True.
          border_type (str, optional): Border type to use for padding of the input. Defaults to "reflect".
          padding (str, optional): Type of padding to apply. Defaults to "same".
      """
      super().__init__()
      sigma = sigma if isinstance(sigma, tuple) else (sigma, sigma)
      self.channels = channels
  
      if kernel_size is None:
          kernel_size = (
              compute_kernel_size(sigma[0]),
              compute_kernel_size(sigma[1]),
          )
      else:
          kernel_size = (
              kernel_size
              if isinstance(kernel_size, tuple)
              else (kernel_size, kernel_size)
          )
  
      self.kernel: Tensor
      self.register_buffer(
          "kernel",
          get_gaussian_kernel2d(kernel_size=kernel_size, sigma=sigma),
      )
      if normalize:
          self.kernel = normalize_kernel2d(self.kernel)
      self.kernel.unsqueeze_(0).unsqueeze_(0)
      self.kernel = self.kernel.expand(self.channels, -1, -1, -1)
      self.border_type = border_type
      self.padding = padding
      self.height, self.width = self.kernel.shape[-2:]
      self.padding_shape = _compute_padding([self.height, self.width])
  
file_path: anomalib/src/anomalib/models/components/filters/blur.py
imports: from __future__ import annotations
  from kornia.filters import get_gaussian_kernel2d
  from kornia.filters.filter import _compute_padding
  from kornia.filters.kernels import normalize_kernel2d
  from torch import Tensor, nn
  from torch.nn import functional
label_desc: Use image node_id 1 to create a new GaussianBlur2d object from inherited base classes: nn with example: obj = GaussianBlur2d(sigma, channels, kernel_size, normalize, border_type, padding)