dim_change is the place where the skip connection is taking place while i am implementing resNet18 model  , please help me to resolve the code for this line as its too complex for me …
dim_change = None # set to None by default

#condition when dimension change is not None

if stride != 1 or planes != self.input_planes * block.expansion :

      dim_change = nn.Sequential(my_conv(self.input_planes , planes * block.expansion , kernel_size=1, stride = stride),

                                      nn.GroupNorm( num_channels = (planes * (block.expansion)) , num_groups= 32 ) )

because this is how resnet18 architecture looks in the github repo 1
image781×726 38.7 KB