def to_cpu(array, stream=None):
 if isinstance(array, ndarray):
  check_cuda_available()
  with get_device(array):
   return array.get(stream)
 elif isinstance(array, numpy.ndarray):
  return array
 else:
  raise TypeError('The array sent to cpu must be numpy.ndarray or cupy.ndarray.\nActual type: {0}.'.format(type(array)))

def to_cpu ( array , stream = None ) : if isinstance ( array , ndarray ) : check_cuda_available ( ) with get_device ( array ) : return array . get ( stream ) elif isinstance ( array , numpy . ndarray ) : return array else : raise TypeError ( 'The array sent to cpu must be numpy.ndarray or cupy.ndarray.\nActual type: {0}.' . format ( type ( array ) ) )
copies the given gpu array to host cpu .