Surely you do need inputs to compute weights gradients. But in this case, weights have flag requires_grad=False so these gradients will not be computed.
I don’t sure if I understand ReLU argument. First of all, there are no activation layers in the given code for conv2 sequential block (which is strange). And second, in the general case, we have activation functions and we do need to know their inputs to calculate gradient but it is their job to save the input. But I see some complications then in-place activations used.