class_docstr: Blur an image using the box filter.
  
  The function smooths an image using the kernel:
  
  .. math::
      K = \frac{1}{\text{kernel_size}_x * \text{kernel_size}_y}
      \begin{bmatrix}
          1 & 1 & 1 & \cdots & 1 & 1 \\
          1 & 1 & 1 & \cdots & 1 & 1 \\
          \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
          1 & 1 & 1 & \cdots & 1 & 1 \\
      \end{bmatrix}
  
  Args:
      kernel_size: the blurring kernel size.
      border_type: the padding mode to be applied before convolving.
        The expected modes are: ``'constant'``, ``'reflect'``,
        ``'replicate'`` or ``'circular'``. Default: ``'reflect'``.
      separable: run as composition of two 1d-convolutions.
  
  Returns:
      the blurred input tensor.
  
  Shape:
      - Input: :math:`(B, C, H, W)`
      - Output: :math:`(B, C, H, W)`
  
  Example:
      >>> input = torch.rand(2, 4, 5, 7)
      >>> blur = BoxBlur((3, 3))
      >>> output = blur(input)  # 2x4x5x7
      >>> output.shape
      torch.Size([2, 4, 5, 7])
code: def __init__(
      self,
      kernel_size: tuple[int, int] | int,
      border_type: str = "reflect",
      separable: bool = False,
  ) -> None:
      super().__init__()
      self.kernel_size = kernel_size
      self.border_type = border_type
      self.separable = separable
  
      if separable:
          ky, kx = _unpack_2d_ks(self.kernel_size)
          self.register_buffer("kernel_y", get_box_kernel1d(ky))
          self.register_buffer("kernel_x", get_box_kernel1d(kx))
          self.kernel_y: Tensor
          self.kernel_x: Tensor
      else:
          self.register_buffer("kernel", get_box_kernel2d(kernel_size))
          self.kernel: Tensor
  
file_path: kornia/kornia/filters/blur.py
imports: from __future__ import annotations
  from kornia.core import Module, Tensor
  from kornia.core.check import KORNIA_CHECK_IS_TENSOR
  from .filter import filter2d, filter2d_separable
  from .kernels import _unpack_2d_ks, get_box_kernel1d, get_box_kernel2d
label_desc: Use image node_id 1 to create a new BoxBlur object from inherited base classes: Module with example: obj = BoxBlur(kernel_size, border_type, separable)