Manual Backward, how to get the parameters gradients at the end of the fit method

mind reproduce it with the below code sample? will check