File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6060del inspect
6161del numbers
6262del os
63- del np
63+
64+ if (AF_NUMPY_FOUND ):
65+ del np
Original file line number Diff line number Diff line change 1616"""
1717
1818from .array import *
19- from .data import reorder
2019
2120try :
2221 import numpy as np
23- AF_NP_FOUND = True
22+ from .data import reorder
23+
24+ AF_NUMPY_FOUND = True
2425
2526 def np_to_af_array (np_arr ):
2627 """
@@ -32,7 +33,7 @@ def np_to_af_array(np_arr):
3233
3334 Returns
3435 ---------
35- af_arry : arrayfire.Array()
36+ af_arr : arrayfire.Array()
3637 """
3738 if (np_arr .flags ['F_CONTIGUOUS' ]):
3839 return Array (np_arr .ctypes .data , np_arr .shape , np_arr .dtype .char )
@@ -55,5 +56,7 @@ def np_to_af_array(np_arr):
5556 raise RuntimeError ("Unsupported ndim" )
5657 else :
5758 return np_to_af_array (np .asfortranarray (np_arr ))
59+
60+ from_ndarray = np_to_af_array
5861except :
59- AF_NP_FOUND = False
62+ AF_NUMPY_FOUND = False
You can’t perform that action at this time.
0 commit comments