class_docstr: A Local Feature Transformer (LoFTR) module.
class_docstr_tok: ["A","Local","Feature","Transformer","(","LoFTR",")","module","."]
code: def __init__(self, config: dict[str, Any]) -> None:
      super().__init__()
  
      self.config = config
      self.d_model = config["d_model"]
      self.nhead = config["nhead"]
      self.layer_names = config["layer_names"]
      encoder_layer = LoFTREncoderLayer(
          config["d_model"], config["nhead"], config["attention"]
      )
      self.layers = nn.ModuleList(
          [
              copy.deepcopy(encoder_layer)
              for _ in range(len(self.layer_names))
          ]
      )
      self._reset_parameters()
  
file_path: kornia/kornia/feature/loftr/loftr_module/transformer.py
imports: from __future__ import annotations
  import copy
  from typing import Any, Literal, Optional
  import torch
  from torch import nn
  from kornia.core import Module, Tensor
  from .linear_attention import FullAttention, LinearAttention
label_desc: Use image node_id 1 to create a new LocalFeatureTransformer object from inherited base classes: Module with example: obj = LocalFeatureTransformer(config)