code: def _compute_padding(kernel_size: list[int]) -> list[int]:
      """Compute padding tuple."""
      # 4 or 6 ints:  (padding_left, padding_right,padding_top,padding_bottom)
      # https://pytorch.org/docs/stable/nn.html#torch.nn.functional.pad
      if len(kernel_size) < 2:
          raise AssertionError(kernel_size)
      computed = [k - 1 for k in kernel_size]
  
      # for even kernels we need to do asymmetric padding :(
      out_padding = 2 * len(kernel_size) * [0]
  
      for i in range(len(kernel_size)):
          computed_tmp = computed[-(i + 1)]
  
          pad_front = computed_tmp // 2
          pad_rear = computed_tmp - pad_front
  
          out_padding[2 * i + 0] = pad_front
          out_padding[2 * i + 1] = pad_rear
  
      return out_padding
  
file_path: kornia/kornia/filters/filter.py
imports: from __future__ import annotations
  import torch.nn.functional
  from kornia.core import Tensor, pad
  from kornia.core.check import KORNIA_CHECK, KORNIA_CHECK_IS_TENSOR, KORNIA_CHECK_SHAPE
  from .kernels import normalize_kernel2d
label_desc: Use image node_id 1 for calling a global function with example usage: _compute_padding(kernel_size) and returns: out_padding