class_docstr: Key.Net model definition -- local feature detector (response function). This is based on the original code
  from paper "Key.Net: Keypoint Detection by Handcrafted and Learned CNN Filters". See :cite:`KeyNet2019` for
  more details.
  
  .. image:: _static/img/KeyNet.png
  
  Args:
      pretrained: Download and set pretrained weights to the model.
      keynet_conf: Dict with initialization parameters. Do not pass it, unless you know what you are doing`.
  
  Returns:
      KeyNet response score.
  
  Shape:
      - Input: :math:`(B, 1, H, W)`
      - Output: :math:`(B, 1, H, W)`
docstr: x - input image
docstr_tok: ["x","-","input","image"]
code: def forward(self, x: Tensor) -> Tensor:
      """
      x - input image
      """
      shape_im = x.shape
      feats: List[Tensor] = [self.feature_extractor(x)]
      for i in range(1, self.num_levels):
          x = pyrdown(x, factor=1.2)
          feats_i = self.feature_extractor(x)
          feats_i = F.interpolate(
              feats_i, size=(shape_im[2], shape_im[3]), mode="bilinear"
          )
          feats.append(feats_i)
      scores = self.last_conv(concatenate(feats, 1))
      return scores
  
imports: from typing import List, Optional
  import torch
  import torch.nn.functional
  from torch import nn
  from typing_extensions import TypedDict
  from kornia.core import Module, Tensor, concatenate
  from kornia.filters import SpatialGradient
  from kornia.geometry.transform import pyrdown
  from kornia.utils.helpers import map_location_to_cpu
  from .scale_space_detector import Detector_config, MultiResolutionDetector, get_default_detector_config
label_desc: Use image node_id 2 for calling the KeyNet obj's underlying member method code with example usage: obj.forward(x) and returns: scores