def get_padding_type(kernel_params, input_shape, output_shape):
 (k_h, k_w, s_h, s_w, p_h, p_w) = kernel_params
 s_o_h = np.ceil((input_shape.height / float(s_h)))
 s_o_w = np.ceil((input_shape.width / float(s_w)))
 if ((output_shape.height == s_o_h) and (output_shape.width == s_o_w)):
  return 'SAME'
 v_o_h = np.ceil((((input_shape.height - k_h) + 1.0) / float(s_h)))
 v_o_w = np.ceil((((input_shape.width - k_w) + 1.0) / float(s_w)))
 if ((output_shape.height == v_o_h) and (output_shape.width == v_o_w)):
  return 'VALID'
 return None

def get_padding_type ( kernel_params , input_shape , output_shape ) : ( k_h , k_w , s_h , s_w , p_h , p_w ) = kernel_params s_o_h = np . ceil ( ( input_shape . height / float ( s_h ) ) ) s_o_w = np . ceil ( ( input_shape . width / float ( s_w ) ) ) if ( ( output_shape . height == s_o_h ) and ( output_shape . width == s_o_w ) ) : return 'SAME' v_o_h = np . ceil ( ( ( ( input_shape . height - k_h ) + 1.0 ) / float ( s_h ) ) ) v_o_w = np . ceil ( ( ( ( input_shape . width - k_w ) + 1.0 ) / float ( s_w ) ) ) if ( ( output_shape . height == v_o_h ) and ( output_shape . width == v_o_w ) ) : return 'VALID' return None
translates caffes numeric padding to one of .