code: def nms(
      signal: Tensor, window_size: int = 5, cutoff: float = 0.0
  ) -> Tensor:
      if window_size % 2 != 1:
          raise ValueError(
              f"window_size has to be odd, got {window_size}"
          )
  
      _, ixs = F.max_pool2d(
          signal,
          kernel_size=window_size,
          stride=1,
          padding=window_size // 2,
          return_indices=True,
      )
  
      h, w = signal.shape[1:]
      coords = torch.arange(h * w, device=signal.device).reshape(
          1, h, w
      )
      nms = ixs == coords
  
      if cutoff is None:
          return nms
      else:
          return nms & (signal > cutoff)
  
file_path: kornia/kornia/feature/disk/detector.py
imports: from __future__ import annotations
  from typing import Optional
  import torch
  import torch.nn.functional
  from kornia.core import Tensor
  from .structs import Keypoints
label_desc: Use image node_id 1 for calling a global function with example usage: nms(signal, window_size, cutoff) and returns: nms, unknown