@@ -0,0 +1,892 @@
+import numpy as np%0Aimport copperhead.compiler.backendtypes as ET%0Aimport copperhead.compiler.coretypes as T%0Afrom copperhead.compiler.conversions import back_to_front_type%0A%0A%0Adef to_numpy(ary):%0A    front_type = back_to_front_type(ary.type)%0A    if not isinstance(front_type, T.Seq):%0A        raise ValueError(%22Not convertible to numpy%22)%0A    sub = front_type.unbox()%0A    if str(sub) == str(T.Int):%0A        return np.fromiter(ary, dtype=np.int32, count=-1)%0A    elif str(sub) == str(T.Long):%0A        return np.fromiter(ary, dtype=np.int64, count=-1)%0A    elif str(sub) == str(T.Float):%0A        return np.fromiter(ary, dtype=np.float32, count=-1)%0A    elif str(sub) == str(T.Double):%0A        return np.fromiter(ary, dtype=np.float64, count=-1)%0A    elif str(sub) == str(T.Bool):%0A        return np.fromiter(ary, dtype=np.bool, count=-1)%0A    else:%0A        raise ValueError(%22Not convertible to numpy%22)%0A    %0A

Add conversion function between cuarray and np.ndarray.