-
Notifications
You must be signed in to change notification settings - Fork 64
Closed
Milestone
Description
Would it be possible to support interoperability with numpy?
import numpy as np
import arrayfire as af
A = np.zeros((2,3), dtype=np.complex64)
Ad = af.array(A) # <-- load data from a numpy array
af.display(Ad)
print(Ad.elements(), Ad.type(), Ad.dims(), Ad.numdims())
Currently:
Using opencl backend
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-c8c7947108da> in <module>()
3
4 A = np.zeros((2,3), dtype=np.complex64)
----> 5 Ad = af.array(A) # <-- load data from a numpy array
6 af.display(Ad)
7 print(Ad.elements(), Ad.type(), Ad.dims(), Ad.numdims())
/Users/cmey/Code/GitHub/arrayfire-python/arrayfire/array.pyc in __init__(self, src, dims)
133 type_char = tmp.typecode
134 else:
--> 135 raise TypeError("src is an object of unsupported class")
136
137 elements = 1
TypeError: src is an object of unsupported class
Metadata
Metadata
Assignees
Labels
No labels