Divergence of convolutional neural network?

Given a convolutional neural network f that takes an image as input and outputs another image of the same dimension, is it somehow possible to calculate the divergence of f for a specific input image (the sum of each partial derivative of an output pixel value with respect to the corresponding input pixel value), without having to evaluate the network once per output pixel?