class_docstr: Helper class for KeyNet, it defines the handcrafted filters within the Key.Net handcrafted block.
code: def forward(self, x: Tensor) -> Tensor:
      sobel = self.spatial_gradient(x)
      dx, dy = sobel[:, :, 0, :, :], sobel[:, :, 1, :, :]
  
      sobel_dx = self.spatial_gradient(dx)
      dxx, dxy = sobel_dx[:, :, 0, :, :], sobel_dx[:, :, 1, :, :]
  
      sobel_dy = self.spatial_gradient(dy)
      dyy = sobel_dy[:, :, 1, :, :]
  
      hc_feats = concatenate(
          [
              dx,
              dy,
              dx**2.0,
              dy**2.0,
              dx * dy,
              dxy,
              dxy**2.0,
              dxx,
              dyy,
              dxx * dyy,
          ],
          1,
      )
  
      return hc_feats
  
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 _HandcraftedBlock obj's underlying member method code with example usage: obj.forward(x) and returns: hc_feats