class_docstr: Implement Adaptive 2D positional encoder for SATRN, see `SATRN.
  
  <https://arxiv.org/abs/1910.04396>`_ Modified from
  https://github.com/Media-Smart/vedastr Licensed under the Apache License,
  Version 2.0 (the "License");
  
  Args:
      d_hid (int): Dimensions of hidden layer. Defaults to 512.
      n_height (int): Max height of the 2D feature output. Defaults to 100.
      n_width (int): Max width of the 2D feature output. Defaults to 100.
      dropout (float): Dropout rate. Defaults to 0.1.
      init_cfg (dict or list[dict], optional): Initialization configs.
          Defaults to [dict(type='Xavier', layer='Conv2d')]
docstr: Generate scale factor layers.
docstr_tok: ["Generate","scale","factor","layers","."]
code: def _scale_factor_generate(d_hid: int) -> nn.Sequential:
      """Generate scale factor layers."""
      scale_factor = nn.Sequential(
          nn.Conv2d(d_hid, d_hid, kernel_size=1),
          nn.ReLU(inplace=True),
          nn.Conv2d(d_hid, d_hid, kernel_size=1),
          nn.Sigmoid(),
      )
  
      return scale_factor
  
imports: from typing import Dict, List, Optional, Union
  import numpy
  import torch
  import torch.nn
  from mmcv.cnn import ConvModule
  from mmengine.model import BaseModule
  from torch import Tensor
  from mmocr.models.common import MultiHeadAttention
label_desc: Use image node_id 3 for calling the Adaptive2DPositionalEncoding obj's underlying member method code with example usage: obj._scale_factor_generate(d_hid) and returns: scale_factor