def assert_allclose(x, y, atol=1e-05, rtol=0.0001, verbose=True):
 x = cuda.to_cpu(utils.force_array(x))
 y = cuda.to_cpu(utils.force_array(y))
 try:
  numpy.testing.assert_allclose(x, y, atol=atol, rtol=rtol, verbose=verbose)
 except Exception:
  print ('error:', numpy.abs((x - y)).max())
  raise

def assert_allclose ( x , y , atol = 1e-05 , rtol = 0.0001 , verbose = True ) : x = cuda . to_cpu ( utils . force_array ( x ) ) y = cuda . to_cpu ( utils . force_array ( y ) ) try : numpy . testing . assert_allclose ( x , y , atol = atol , rtol = rtol , verbose = verbose ) except Exception : print ( 'error:' , numpy . abs ( ( x - y ) ) . max ( ) ) raise
asserts if some corresponding element of x and y differs too much .