Here is an axample code.
1)loss function

Screenshot from 2021-08-04 01-19-08937×227 29.1 KB

2)training loop

Screenshot from 2021-08-04 01-20-54731×709 69.4 KB

This is an example code for something that I want to do. Here when i print output_label.grad , it returns None. I don’t get what I am doing wring here. Also, can you please give an example about how can i get rid of the for loops ?