Thank you @KaiHoo, one question:
Why is the - min_val[:, :, None, None] within the denominator necessary? I just tested it and it works perfectly, but I don’t understand why. If we don’t want to normalize all feature maps independently we can just use X /= X.max().
Edit: Ahh I understand, it’s because in your first example the max values are determined by the min-subtracted tensor.