class_docstr: Stage of ResNet.
class_docstr_tok: ["Stage","of","ResNet","."]
code: def _construct(self, w_in, w_out, stride, d, w_b, num_gs):
      # Construct the blocks
      for i in range(d):
          # Stride and w_in apply to the first block of the stage
          b_stride = stride if i == 0 else 1
          b_w_in = w_in if i == 0 else w_out
          # Retrieve the transformation function
          trans_fun = get_trans_fun(self.transfun)
          # Construct the block
          res_block = ResBlock(
              b_w_in,
              w_out,
              b_stride,
              trans_fun,
              self.has_bn,
              self.has_st,
              self.use_srelu,
              w_b,
              num_gs,
          )
          self.add_module("b{}".format(i + 1), res_block)
  
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the ResStage obj's underlying member method code with example usage: obj._construct(w_in, w_out, stride, d, w_b, num_gs) without return types