here is the function using to backward in a caffe cnn, the top are the output of this layer and bottom are the input from previous layer
def backward(self,top,propagate_down,bottom):
if propagate_down[0] and self.count!=0:
bottom[0].diff[...]=0
bottom[0].diff[self.valid_index]=top[0].diff[...]
if propagate_down[1] and self.count!=0:
bottom[1].diff[...]=0
bottom[1].diff[self.valid_index]=top[1].diff[...]
eh... what does the .diff[...]=0 means?