code: def __init__(
      self, feat_chans: int, state_chans: int, attention_units: int
  ) -> None:
      super().__init__()
      self.feat_conv = nn.Conv2d(
          feat_chans, attention_units, kernel_size=3, padding=1
      )
      # No need to add another bias since both tensors are summed together
      self.state_conv = nn.Conv2d(
          state_chans, attention_units, kernel_size=1, bias=False
      )
      self.attention_projector = nn.Conv2d(
          attention_units, 1, kernel_size=1, bias=False
      )
  
imports: from copy import deepcopy
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import torch
  from torch import nn
  from torch.nn import functional
  from torchvision.models._utils import IntermediateLayerGetter
  from doctr.datasets import VOCABS
  from ...classification import resnet31
  from ...utils.pytorch import _bf16_to_float32, load_pretrained_params
  from ..core import RecognitionModel, RecognitionPostProcessor
label_desc: Use image node_id 1 to create a new AttentionModule object from inherited base classes: nn with example: obj = AttentionModule(feat_chans, state_chans, attention_units)