class_docstr: A classic ResNet's residual layer composed by two `3x3` convolutions.
class_docstr_tok: ["A","classic","ResNet","'s","residual","layer","composed","by","two","`","3x3","`","convolutions","."]
code: def forward(self, hidden_state):
      residual = hidden_state
      hidden_state = self.layer(hidden_state)
      residual = self.shortcut(residual)
      hidden_state += residual
      hidden_state = self.activation(hidden_state)
      return hidden_state
  
imports: from typing import Optional
  import torch
  import torch.utils.checkpoint
  from torch import Tensor, nn
  from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
  from ...activations import ACT2FN
  from ...modeling_outputs import BackboneOutput, BaseModelOutputWithNoAttention, BaseModelOutputWithPoolingAndNoAttention, ImageClassifierOutputWithNoAttention
  from ...modeling_utils import PreTrainedModel
  from ...utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward, logging, replace_return_docstrings
  from ...utils.backbone_utils import BackboneMixin
  from .configuration_resnet import ResNetConfig
label_desc: Use image node_id 2 for calling the ResNetBasicLayer obj's underlying member method code with example usage: obj.forward(hidden_state) and returns: hidden_state