class_docstr: A simple softmax attention  operation
  LoFTR implementation reference: https://github.com/zju3dv/LoFTR/blob/2122156015b61fbb650e28b58a958e4d632b1058/src/loftr/loftr_module/linear_attention.py
class_docstr_tok: ["A","simple","softmax","attention","operation","LoFTR","implementation","reference",":","https",":","\/\/github.com\/zju3dv\/LoFTR\/blob\/2122156015b61fbb650e28b58a958e4d632b1058\/src\/loftr\/loftr_module\/linear_attention.py"]
code: def __init__(self, dropout: float = 0.0) -> None:
      super().__init__()
      self.dropout = nn.Dropout(dropout) if dropout else nn.Identity()
  
imports: import math
  from functools import partial
  from typing import Callable, Dict, Iterable, List, Optional, Tuple
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import torchvision.models.optical_flow.raft
  from torch import Tensor
  from torchvision.models._api import register_model, Weights, WeightsEnum
  from torchvision.models._utils import handle_legacy_interface
  from torchvision.models.optical_flow._utils import grid_sample, make_coords_grid, upsample_flow
  from torchvision.ops import Conv2dNormActivation
  from torchvision.prototype.transforms._presets import StereoMatching
label_desc: Use image node_id 1 to create a new SoftmaxAttention object from inherited base classes: nn with example: obj = SoftmaxAttention(dropout)