def max_pool_2d_same_size(input, patch_size):
 output = Pool(True)(input, patch_size)
 outs = MaxPoolGrad(True)(input, output, output, patch_size)
 return outs

def max_pool_2d_same_size ( input , patch_size ) : output = Pool ( True ) ( input , patch_size ) outs = MaxPoolGrad ( True ) ( input , output , output , patch_size ) return outs
takes as input a 4-d tensor .