def getwhere(x):
 (y_prepool, y_postpool) = x
 return K.gradients(K.sum(y_postpool), y_prepool)

def getwhere ( x ) : ( y_prepool , y_postpool ) = x return K . gradients ( K . sum ( y_postpool ) , y_prepool )
calculate the "where" mask that contains switches indicating which index contained the max value when maxpool2d was applied .