code: def hessian_response(
      input: Tensor,
      grads_mode: str = "sobel",
      sigmas: Optional[Tensor] = None,
  ) -> Tensor:
      r"""Compute the absolute of determinant of the Hessian matrix.
  
      .. image:: _static/img/hessian_response.png
  
      Function does not do any normalization or nms. The response map is computed according the following formulation:
  
      .. math::
          R = det(H)
  
      where:
  
      .. math::
          M = \sum_{(x,y) \in W}
          \begin{bmatrix}
              I_{xx} & I_{xy} \\
              I_{xy} & I_{yy} \\
          \end{bmatrix}
  
      Args:
          input: input image with shape :math:`(B, C, H, W)`.
          grads_mode: can be ``'sobel'`` for standalone use or ``'diff'`` for use on Gaussian pyramid.
          sigmas: coefficients to be multiplied by multichannel response. Should be shape of :math:`(B)`
            It is necessary for performing non-maxima-suppression across different scale pyramid levels.
            See `vlfeat <https://github.com/vlfeat/vlfeat/blob/master/vl/covdet.c#L874>`_.
  
      Return:
          the response map per channel with shape :math:`(B, C, H, W)`.
  
      Shape:
         - Input: :math:`(B, C, H, W)`
         - Output: :math:`(B, C, H, W)`
  
      Examples:
          >>> input = torch.tensor([[[
          ...    [0., 0., 0., 0., 0., 0., 0.],
          ...    [0., 1., 1., 1., 1., 1., 0.],
          ...    [0., 1., 1., 1., 1., 1., 0.],
          ...    [0., 1., 1., 1., 1., 1., 0.],
          ...    [0., 1., 1., 1., 1., 1., 0.],
          ...    [0., 1., 1., 1., 1., 1., 0.],
          ...    [0., 0., 0., 0., 0., 0., 0.],
          ... ]]])  # 1x1x7x7
          >>> # compute the response map
          hessian_response(input)
          tensor([[[[0.0155, 0.0334, 0.0194, 0.0000, 0.0194, 0.0334, 0.0155],
                    [0.0334, 0.0575, 0.0339, 0.0000, 0.0339, 0.0575, 0.0334],
                    [0.0194, 0.0339, 0.0497, 0.0000, 0.0497, 0.0339, 0.0194],
                    [0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                    [0.0194, 0.0339, 0.0497, 0.0000, 0.0497, 0.0339, 0.0194],
                    [0.0334, 0.0575, 0.0339, 0.0000, 0.0339, 0.0575, 0.0334],
                    [0.0155, 0.0334, 0.0194, 0.0000, 0.0194, 0.0334, 0.0155]]]])
      """
      # TODO: Recompute doctest
      KORNIA_CHECK_SHAPE(input, ["B", "C", "H", "W"])
  
      if sigmas is not None:
          if not isinstance(sigmas, Tensor):
              raise TypeError(
                  f"sigmas type is not a Tensor. Got {type(sigmas)}"
              )
  
          if (not len(sigmas.shape) == 1) or (
              sigmas.size(0) != input.size(0)
          ):
              raise ValueError(
                  f"Invalid sigmas shape, we expect B == input.size(0). Got: {sigmas.shape}"
              )
  
      gradients: Tensor = spatial_gradient(input, grads_mode, 2)
      dxx: Tensor = gradients[:, :, 0]
      dxy: Tensor = gradients[:, :, 1]
      dyy: Tensor = gradients[:, :, 2]
  
      scores: Tensor = dxx * dyy - dxy**2
  
      if sigmas is not None:
          scores = scores * sigmas.pow(4).view(-1, 1, 1, 1)
  
      return scores
  
imports: from typing import Optional, Union
  import torch
  from kornia.core import Module, Tensor, tensor
  from kornia.core.check import KORNIA_CHECK_SHAPE
  from kornia.filters import gaussian_blur2d, spatial_gradient
label_desc: Use image node_id 4 for calling a global function with example usage: hessian_response(input, grads_mode, sigmas) and returns: scores