class_docstr: The residual connection is defined in TimesformerLayer instead of here (as is the case with other models), due to
  the layernorm applied before each block.
class_docstr_tok: ["The","residual","connection","is","defined","in","TimesformerLayer","instead","of","here","(","as","is","the","case","with","other","models",")",",","due","to","the","layernorm","applied","before","each","block","."]
code: def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
      hidden_states = self.dense(hidden_states)
      hidden_states = self.dropout(hidden_states)
  
      return hidden_states
  
imports: import collections
  from typing import Optional, Tuple, Union
  import torch
  import torch.nn.functional
  import torch.utils.checkpoint
  from torch import nn
  from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
  from ...activations import ACT2FN
  from ...modeling_outputs import BaseModelOutput, ImageClassifierOutput
  from ...modeling_utils import PreTrainedModel
  from ...utils import add_start_docstrings, add_start_docstrings_to_model_forward, logging, replace_return_docstrings
  from .configuration_timesformer import TimesformerConfig
label_desc: Use image node_id 2 for calling the TimesformerSelfOutput obj's underlying member method code with example usage: obj.forward(hidden_states) and returns: hidden_states