File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 60
60
del inspect
61
61
del numbers
62
62
del os
63
- del np
63
+
64
+ if (AF_NUMPY_FOUND ):
65
+ del np
Original file line number Diff line number Diff line change 16
16
"""
17
17
18
18
from .array import *
19
- from .data import reorder
20
19
21
20
try :
22
21
import numpy as np
23
- AF_NP_FOUND = True
22
+ from .data import reorder
23
+
24
+ AF_NUMPY_FOUND = True
24
25
25
26
def np_to_af_array (np_arr ):
26
27
"""
@@ -32,7 +33,7 @@ def np_to_af_array(np_arr):
32
33
33
34
Returns
34
35
---------
35
- af_arry : arrayfire.Array()
36
+ af_arr : arrayfire.Array()
36
37
"""
37
38
if (np_arr .flags ['F_CONTIGUOUS' ]):
38
39
return Array (np_arr .ctypes .data , np_arr .shape , np_arr .dtype .char )
@@ -55,5 +56,7 @@ def np_to_af_array(np_arr):
55
56
raise RuntimeError ("Unsupported ndim" )
56
57
else :
57
58
return np_to_af_array (np .asfortranarray (np_arr ))
59
+
60
+ from_ndarray = np_to_af_array
58
61
except :
59
- AF_NP_FOUND = False
62
+ AF_NUMPY_FOUND = False
You can’t perform that action at this time.
0 commit comments