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 thing, after executing the above code snippet, you can access the gradients as
weight.grad