code: def blur_pool2d(
      input: Tensor, kernel_size: tuple[int, int] | int, stride: int = 2
  ) -> Tensor:
      r"""Compute blurs and downsample a given feature map.
  
      .. image:: _static/img/blur_pool2d.png
  
      See :class:`~kornia.filters.BlurPool2D` for details.
  
      See :cite:`zhang2019shiftinvar` for more details.
  
      Args:
          kernel_size: the kernel size for max pooling..
          ceil_mode: should be true to match output size of conv2d with same kernel size.
  
      Shape:
          - Input: :math:`(B, C, H, W)`
          - Output: :math:`(N, C, H_{out}, W_{out})`, where
  
            .. math::
                H_{out} = \left\lfloor\frac{H_{in}  + 2 \times \text{kernel\_size//2}[0] -
                  \text{kernel\_size}[0]}{\text{stride}[0]} + 1\right\rfloor
  
            .. math::
                W_{out} = \left\lfloor\frac{W_{in}  + 2 \times \text{kernel\_size//2}[1] -
                  \text{kernel\_size}[1]}{\text{stride}[1]} + 1\right\rfloor
  
      Returns:
          the transformed tensor.
  
      .. note::
          This function is tested against https://github.com/adobe/antialiased-cnns.
  
      .. note::
         See a working example `here <https://kornia.github.io/tutorials/nbs/filtering_operators.html>`__.
  
      Examples:
          >>> input = torch.eye(5)[None, None]
          >>> blur_pool2d(input, 3)
          tensor([[[[0.3125, 0.0625, 0.0000],
                    [0.0625, 0.3750, 0.0625],
                    [0.0000, 0.0625, 0.3125]]]])
      """
      kernel = get_pascal_kernel_2d(
          kernel_size, norm=True, device=input.device, dtype=input.dtype
      ).repeat((input.size(1), 1, 1, 1))
      return _blur_pool_by_kernel2d(input, kernel, stride)
  
imports: from __future__ import annotations
  import torch.nn.functional
  from kornia.core import Module, Tensor, as_tensor, pad, tensor
  from kornia.core.check import KORNIA_CHECK, KORNIA_CHECK_SHAPE
  from .kernels import get_pascal_kernel_2d
  from .median import _compute_zero_padding
label_desc: Use image node_id 1 for calling a global function with example usage: blur_pool2d(input, kernel_size, stride) and returns: _blur_pool_by_kernel2d