Solved by shivammehta007 in post #2 
              
              
                def count_parameters(model):
    return sum(param.numel() for param in model.parameters())

This function will help you to count the number of parameters in your model