Solved by cmauceri in post #4 
              
              
                I found the parameters you meant. You mean the the weight and bias are Parameter instances and that they contain the gradients as member variable grad. I was able to use those variable to compare and my method is working correctly  
Thank you. 
For any future readers who are looking for the same thi…