def _inputs_swap_needed(mode, shape1, shape2):
 if (mode == 'valid'):
  (ok1, ok2) = (True, True)
  for (d1, d2) in zip(shape1, shape2):
   if (not (d1 >= d2)):
    ok1 = False
   if (not (d2 >= d1)):
    ok2 = False
  if (not (ok1 or ok2)):
   raise ValueError("For 'valid' mode, one must be at least as large as the other in every dimension")
  return (not ok1)
 return False

def _inputs_swap_needed ( mode , shape1 , shape2 ) : if ( mode == 'valid' ) : ( ok1 , ok2 ) = ( True , True ) for ( d1 , d2 ) in zip ( shape1 , shape2 ) : if ( not ( d1 >= d2 ) ) : ok1 = False if ( not ( d2 >= d1 ) ) : ok2 = False if ( not ( ok1 or ok2 ) ) : raise ValueError ( "For 'valid' mode, one must be at least as large as the other in every dimension" ) return ( not ok1 ) return False
if in valid mode .