Gradient distribution of the feature map

Hi, how can I get the gradient distribution of a feature map, some thing likes the current gradient of each pixel.

wonder about wihch function can give the gradient map with numbers

thanks to any guidance