If you are just working with “vanilla” neural networks, i.e. you just use the nn.Modules, you usually don’t need to set requires_grad anywhere.
You would have to define your model, data, criterion, and are good to go.
Also, have a look at the PyTorch Tutorials 3.