code: def bilateral_blur(
      input: Tensor,
      kernel_size: tuple[int, int] | int,
      sigma_color: float | Tensor,
      sigma_space: tuple[float, float] | Tensor,
      border_type: str = "reflect",
      color_distance_type: str = "l1",
  ) -> Tensor:
      r"""Blur a tensor using a Bilateral filter.
  
      .. image:: _static/img/bilateral_blur.png
  
      The operator is an edge-preserving image smoothing filter. The weight
      for each pixel in a neighborhood is determined not only by its distance
      to the center pixel, but also the difference in intensity or color.
  
      Arguments:
          input: the input tensor with shape :math:`(B,C,H,W)`.
          kernel_size: the size of the kernel.
          sigma_color: the standard deviation for intensity/color Gaussian kernel.
            Smaller values preserve more edges.
          sigma_space: the standard deviation for spatial Gaussian kernel.
            This is similar to ``sigma`` in :func:`gaussian_blur2d()`.
          border_type: the padding mode to be applied before convolving.
            The expected modes are: ``'constant'``, ``'reflect'``,
            ``'replicate'`` or ``'circular'``. Default: ``'reflect'``.
          color_distance_type: the type of distance to calculate intensity/color
            difference. Only ``'l1'`` or ``'l2'`` is allowed. Use ``'l1'`` to
            match OpenCV implementation. Use ``'l2'`` to match Matlab implementation.
            Default: ``'l1'``.
  
      Returns:
          the blurred tensor with shape :math:`(B, C, H, W)`.
  
      Examples:
          >>> input = torch.rand(2, 4, 5, 5)
          >>> output = bilateral_blur(input, (3, 3), 0.1, (1.5, 1.5))
          >>> output.shape
          torch.Size([2, 4, 5, 5])
      """
      return _bilateral_blur(
          input,
          None,
          kernel_size,
          sigma_color,
          sigma_space,
          border_type,
          color_distance_type,
      )
  
file_path: kornia/kornia/filters/bilateral.py
imports: from __future__ import annotations
  from typing import Optional
  from kornia.core import Module, Tensor, pad
  from kornia.core.check import KORNIA_CHECK, KORNIA_CHECK_IS_TENSOR, KORNIA_CHECK_SHAPE
  from .kernels import _unpack_2d_ks, get_gaussian_kernel2d
  from .median import _compute_zero_padding
label_desc: Use image node_id 2 for calling a global function with example usage: bilateral_blur(input, kernel_size, sigma_color, sigma_space, border_type, color_distance_type) and returns: _bilateral_blur