How much does the importance of the input pixel change wrt a certain weight

if that works I just spent months doing stuff I didn’t need to… you think it also works by just using the gradients of specific input pixels instead of all of them?