class_docstr: Apply non maxima suppression to filter.
  
  Flag `minima_are_also_good` is useful, when you want to detect both maxima and minima, e.g. for DoG
class_docstr_tok: ["Apply","non","maxima","suppression","to","filter",".","Flag","`","minima_are_also_good","`","is","useful",",","when","you","want","to","detect","both","maxima","and","minima",",","e.g",".","for","DoG"]
code: def _compute_zero_padding2d(
      kernel_size: tuple[int, int]
  ) -> tuple[int, int, int, int]:
      # TODO: This method is duplicated with some utility function on kornia.filters
      if not isinstance(kernel_size, tuple):
          raise AssertionError(type(kernel_size))
      if len(kernel_size) != 2:
          raise AssertionError(kernel_size)
  
      def pad(x: int) -> int:
          return (x - 1) // 2  # zero padding function
  
      ky, kx = kernel_size  # we assume a cubic kernel
      return pad(ky), pad(ky), pad(kx), pad(kx)
  
file_path: kornia/kornia/geometry/subpix/nms.py
imports: from __future__ import annotations
  import torch
  import torch.nn.functional
  from kornia.core import Module, Tensor, eye, pad, zeros
label_desc: Use image node_id 2 for calling the NonMaximaSuppression2d obj's underlying member method code with example usage: obj._compute_zero_padding2d(kernel_size) and returns: pad,  pad,  pad,  pad, unknown