class_docstr: ResNet shortcut, used to project the residual features to the correct size. If needed, it is also used to
  downsample the input using `stride=2`.
class_docstr_tok: ["ResNet","shortcut",",","used","to","project","the","residual","features","to","the","correct","size",".","If","needed",",","it","is","also","used","to","downsample","the","input","using","`","stride=2","`","."]
code: def __init__(
      self, in_channels: int, out_channels: int, stride: int = 2
  ):
      super().__init__()
      self.convolution = nn.Conv2d(
          in_channels,
          out_channels,
          kernel_size=1,
          stride=stride,
          bias=False,
      )
      self.normalization = nn.BatchNorm2d(out_channels)
  
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 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
  from .configuration_resnet import ResNetConfig
label_desc: Use image node_id 1 to create a new ResNetShortCut object from inherited base classes: nn with example: obj = ResNetShortCut(in_channels, out_channels, stride)