Solved by Jami_Anwesh_Kumar in post #3 
              
              
                Thanks a lot @Usama_Hasan it means a lot with your reply but actually i figured it out just now that making alpha and beta part of nn.Parameter in init worked for me.See line 18 and 19 to understand what i meant and i commented some things in forward. 
1. class BasicBlock(nn.Module):

2.     expansi…