class_docstr: Module, which finds correspondences between two images.
  
  This is based on the original code from paper "LoFTR: Detector-Free Local
  Feature Matching with Transformers". See :cite:`LoFTR2021` for more details.
  
  If the distance matrix dm is not provided, :py:func:`torch.cdist` is used.
  
  Args:
      config: Dict with initialization parameters. Do not pass it, unless you know what you are doing`.
      pretrained: Download and set pretrained weights to the model. Options: 'outdoor', 'indoor'.
                  'outdoor' is trained on the MegaDepth dataset and 'indoor'
                  on the ScanNet.
  
  Returns:
      Dictionary with image correspondences and confidence scores.
  
  Example:
      >>> img1 = torch.rand(1, 1, 320, 200)
      >>> img2 = torch.rand(1, 1, 128, 128)
      >>> input = {"image0": img1, "image1": img2}
      >>> loftr = LoFTR('outdoor')
      >>> out = loftr(input)
class_docstr_tok: ["Module",",","which","finds","correspondences","between","two","images",".","This","is","based","on","the","original","code","from","paper","``","LoFTR",":","Detector-Free","Local","Feature","Matching","with","Transformers","''",".","See",":","cite",":","`","LoFTR2021","`","for","more","details",".","If","the","distance","matrix","dm","is","not","provided",",",":","py",":","func",":","`","torch.cdist","`","is","used",".","Args",":","config",":","Dict","with","initialization","parameters",".","Do","not","pass","it",",","unless","you","know","what","you","are","doing","`",".","pretrained",":","Download","and","set","pretrained","weights","to","the","model",".","Options",":","'outdoor","'",",","'indoor","'",".","'outdoor","'","is","trained","on","the","MegaDepth","dataset","and","'indoor'","on","the","ScanNet",".","Returns",":","Dictionary","with","image","correspondences","and","confidence","scores",".","Example",":",">",">",">","img1","=","torch.rand","(","1",",","1",",","320",",","200",")",">",">",">","img2","=","torch.rand","(","1",",","1",",","128",",","128",")",">",">",">","input","=","{","``","image0","''",":","img1",",","``","image1","''",":","img2","}",">",">",">","loftr","=","LoFTR","(","'outdoor","'",")",">",">",">","out","=","loftr","(","input",")"]
code: def load_state_dict(self, state_dict: dict[str, Any], *args: Any, **kwargs: Any) -> Any:  # type: ignore[override]
      for k in list(state_dict.keys()):
          if k.startswith("matcher."):
              state_dict[k.replace("matcher.", "", 1)] = state_dict.pop(
                  k
              )
      return super().load_state_dict(state_dict, *args, **kwargs)
  
file_path: kornia/kornia/feature/loftr/loftr.py
imports: from __future__ import annotations
  from typing import Any, Optional
  import torch
  from kornia.core import Module, Tensor
  from kornia.geometry import resize
  from kornia.utils.helpers import map_location_to_cpu
  from .backbone import build_backbone
  from .loftr_module import FinePreprocess, LocalFeatureTransformer
  from .utils.coarse_matching import CoarseMatching
  from .utils.fine_matching import FineMatching
  from .utils.position_encoding import PositionEncodingSine
label_desc: Use image node_id 3 for calling the LoFTR obj's underlying member method code with example usage: obj.load_state_dict(state_dict) and returns: super