class_docstr: Module, which computes HardNet descriptors of given grayscale patches of 32x32.
  
  This is based on the original code from paper "Working hard to know your neighbor's
  margins: Local descriptor learning loss". See :cite:`HardNet2017` for more details.
  
  Args:
      pretrained: Download and set pretrained weights to the model.
  
  Returns:
      torch.Tensor: HardNet descriptor of the patches.
  
  Shape:
      - Input: :math:`(B, 1, 32, 32)`
      - Output: :math:`(B, 128)`
  
  Examples:
      >>> input = torch.rand(16, 1, 32, 32)
      >>> hardnet = HardNet()
      >>> descs = hardnet(input) # 16x128
class_docstr_tok: ["Module",",","which","computes","HardNet","descriptors","of","given","grayscale","patches","of","32x32",".","This","is","based","on","the","original","code","from","paper","``","Working","hard","to","know","your","neighbor's","margins",":","Local","descriptor","learning","loss","''",".","See",":","cite",":","`","HardNet2017","`","for","more","details",".","Args",":","pretrained",":","Download","and","set","pretrained","weights","to","the","model",".","Returns",":","torch.Tensor",":","HardNet","descriptor","of","the","patches",".","Shape",":","-","Input",":",":","math",":","`","(","B",",","1",",","32",",","32",")","`","-","Output",":",":","math",":","`","(","B",",","128",")","`","Examples",":",">",">",">","input","=","torch.rand","(","16",",","1",",","32",",","32",")",">",">",">","hardnet","=","HardNet","(",")",">",">",">","descs","=","hardnet","(","input",")","#","16x128"]
code: def forward(self, input: torch.Tensor) -> torch.Tensor:
      KORNIA_CHECK_SHAPE(input, ["B", "1", "32", "32"])
      x_norm: torch.Tensor = self._normalize_input(input)
      x_features: torch.Tensor = self.features(x_norm)
      x_out = x_features.view(x_features.size(0), -1)
      return F.normalize(x_out, dim=1)
  
file_path: kornia/kornia/feature/hardnet.py
imports: from typing import Dict
  import torch
  import torch.nn.functional
  from torch import nn
  from kornia.core.check import KORNIA_CHECK_SHAPE
  from kornia.testing import is_mps_tensor_safe
  from kornia.utils.helpers import map_location_to_cpu
label_desc: Use image node_id 3 for calling the HardNet obj's underlying member method code with example usage: obj.forward(input) and returns: F