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, w_in, w_out, stride, norm, activation_class, params
  ):
      super().__init__(w_in, w_out, stride)
      self.proj, self.bn = None, None
      if (w_in != w_out) or (stride != 1):
          self.proj = conv2d(w_in, w_out, 1, stride=stride)
          self.bn = get_norm(norm, w_out)
      self.f = BasicTransform(
          w_in, w_out, stride, norm, activation_class, params
      )
      self.af = activation_class()
  
imports: import numpy
  from torch import nn
  from detectron2.layers import CNNBlockBase, ShapeSpec, get_norm
  from .backbone import Backbone
label_desc: Use image node_id 1 to create a new ResBasicBlock object from inherited base classes: CNNBlockBase with example: obj = ResBasicBlock(w_in, w_out, stride, norm, activation_class, params)