class_docstr: Very simple multi-layer perceptron (also called FFN) with relu. Mostly
  used in DETR series detectors.
  
  Args:
      input_dim (int): Feature dim of the input tensor.
      hidden_dim (int): Feature dim of the hidden layer.
      output_dim (int): Feature dim of the output tensor.
      num_layers (int): Number of FFN layers. As the last
          layer of MLP only contains FFN (Linear).
class_docstr_tok: ["Very","simple","multi-layer","perceptron","(","also","called","FFN",")","with","relu",".","Mostly","used","in","DETR","series","detectors",".","Args",":","input_dim","(","int",")",":","Feature","dim","of","the","input","tensor",".","hidden_dim","(","int",")",":","Feature","dim","of","the","hidden","layer",".","output_dim","(","int",")",":","Feature","dim","of","the","output","tensor",".","num_layers","(","int",")",":","Number","of","FFN","layers",".","As","the","last","layer","of","MLP","only","contains","FFN","(","Linear",")","."]
docstr: Forward function of MLP.
  
  Args:
      x (Tensor): The input feature, has shape
          (num_queries, bs, input_dim).
  Returns:
      Tensor: The output feature, has shape
          (num_queries, bs, output_dim).
code: def forward(self, x: Tensor) -> Tensor:
      """Forward function of MLP.
  
      Args:
          x (Tensor): The input feature, has shape
              (num_queries, bs, input_dim).
      Returns:
          Tensor: The output feature, has shape
              (num_queries, bs, output_dim).
      """
      for i, layer in enumerate(self.layers):
          x = F.relu(layer(x)) if i < self.num_layers - 1 else layer(x)
      return x
  
imports: import math
  import warnings
  from typing import Optional, Sequence, Tuple, Union
  import torch
  import torch.nn.functional
  from mmcv.cnn import Linear, build_activation_layer, build_conv_layer, build_norm_layer
  from mmcv.cnn.bricks.drop import Dropout
  from mmengine.model import BaseModule, ModuleList
  from mmengine.utils import to_2tuple
  from torch import Tensor, nn
  from mmdet.registry import MODELS
  from mmdet.utils import OptConfigType, OptMultiConfig
label_desc: Use image node_id 2 for calling the MLP obj's underlying member method code with example usage: obj.forward(x) and returns: x