Yes.
This is the beauty of automatic differentiation in that as long as you use PyTorch operators and don’t break the computation graph between the previous layer and next layer, the network will perform backprop automatically.