class_docstr: Description
  -----------
  An MLP module.
  
  Parameters
  ----------
  input_d : int
      Number of input features.
  output_d : int
      Number of output features.
  hidden_d : int
      Size of hidden layers.
  num_layers : int
      Number of mlp layers.
  dropout : float
      The dropout rate in mlp layers.
  norm : str
      The type of norm layers inside mlp layers. Can be ``'batch'``, ``'layer'`` or ``'none'``.
  init_activate : bool
      If add a relu at the beginning.
class_docstr_tok: ["Description","--","--","--","--","--","-","An","MLP","module",".","Parameters","--","--","--","--","--","input_d",":","int","Number","of","input","features",".","output_d",":","int","Number","of","output","features",".","hidden_d",":","int","Size","of","hidden","layers",".","num_layers",":","int","Number","of","mlp","layers",".","dropout",":","float","The","dropout","rate","in","mlp","layers",".","norm",":","str","The","type","of","norm","layers","inside","mlp","layers",".","Can","be","``","'batch","'","``",",","``","'layer","'","``","or","``","'none","'","``",".","init_activate",":","bool","If","add","a","relu","at","the","beginning","."]
docstr: The forward pass of mlp.
docstr_tok: ["The","forward","pass","of","mlp","."]
code: def forward(self, x):
      """The forward pass of mlp."""
      self.cur_norm_idx = 0
  
      if self.init_activate:
          x = self.activate(x)
  
      for i, layer in enumerate(self.layers):
          x = layer(x)
          if (
              i != len(self.layers) - 1
          ):  # do not activate in the last layer
              x = self.activate(x)
  
      return x
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from ....None import function
label_desc: Use image node_id 4 for calling the MLP obj's underlying member method code with example usage: obj.forward(x) and returns: x