z = torch.FloatTensor([1,1]).requires_grad_()
out = relu(input)
out = Conv(out)
out = bn(out)
out = global_pooling(out)
logits = classifier(out.view(out.size(0), -1)*z[0])*z[1]

If we have f(x)=Wx, then we can derive the formula \partial L / \partial x * x = \partial L / \partial f(x) * f(x) = \partial L / \partial z_1 = \partial L / \partial z_2 based on the chain rule.

I did not check your code in detail, but given your last message, I think the answer is simply that single precision float numbers are only precise up to 6/7 digits. And there two numbers you show are precise up to that precision. So they are equal in terms of float numbers.
You can use double precision numbers if you want more precise values.