class_docstr: Residual basic block: x + F(x), F = basic transform.
class_docstr_tok: ["Residual","basic","block",":","x","+","F","(","x",")",",","F","=","basic","transform","."]
code: def __init__(
      self,
      width_in: int,
      width_out: int,
      stride: int,
      bn_epsilon: float,
      bn_momentum: float,
      activation: nn.Module,
      *args,
      **kwargs,
  ):
      super().__init__()
      self.proj_block = (width_in != width_out) or (stride != 1)
      if self.proj_block:
          self.proj = nn.Conv2d(
              width_in,
              width_out,
              1,
              stride=stride,
              padding=0,
              bias=False,
          )
          self.bn = nn.BatchNorm2d(
              width_out, eps=bn_epsilon, momentum=bn_momentum
          )
      self.f = BasicTransform(
          width_in,
          width_out,
          stride,
          bn_epsilon,
          bn_momentum,
          activation,
      )
      self.activation = activation
  
      # The projection and transform happen in parallel,
      # and ReLU is not counted with respect to depth
      self.depth = self.f.depth
  
imports: import math
  from collections import OrderedDict
  from enum import auto, Enum
  from typing import Any, Dict, Optional, Sequence
  import torch.nn
  from classy_vision.generic.util import get_torch_version
  from classy_vision.models import ClassyModel, register_model
  from classy_vision.models.squeeze_and_excitation_layer import SqueezeAndExcitationLayer
label_desc: Use image node_id 1 to create a new ResBasicBlock object from inherited base classes: nn with example: obj = ResBasicBlock(width_in, width_out, stride, bn_epsilon, bn_momentum, activation)