class_docstr: MLP as used in Vision Transformer, MLP-Mixer and related networks
class_docstr_tok: ["MLP","as","used","in","Vision","Transformer",",","MLP-Mixer","and","related","networks"]
code: def forward(self, hidden_states):
      hidden_states = self.fc1(hidden_states)
      hidden_states = self.act(hidden_states)
      hidden_states = self.drop(hidden_states)
      hidden_states = self.fc2(hidden_states)
      hidden_states = self.drop(hidden_states)
      return hidden_states
  
imports: import collections.abc
  from dataclasses import dataclass
  from typing import Optional, Tuple, Union
  import torch
  import torch.nn.functional
  import torch.utils.checkpoint
  from torch import nn
  from ...modeling_outputs import BaseModelOutput
  from ...modeling_utils import PreTrainedModel
  from ...utils import ModelOutput, add_start_docstrings, add_start_docstrings_to_model_forward, logging, replace_return_docstrings
  from .configuration_mgp_str import MgpstrConfig
label_desc: Use image node_id 2 for calling the MgpstrMlp obj's underlying member method code with example usage: obj.forward(hidden_states) and returns: hidden_states