def asnumpy(a, stream=None):
 if isinstance(a, ndarray):
  return a.get(stream=stream)
 else:
  return numpy.asarray(a)

def asnumpy ( a , stream = None ) : if isinstance ( a , ndarray ) : return a . get ( stream = stream ) else : return numpy . asarray ( a )
returns an array on the host memory from an arbitrary source array .