@numba.vectorize(nopython=True) def test(x,y): f = np.cos(x+y) g = np.sin(x*y) return f,g
NotImplementedError: (float64 x 2) cannot be represented as a Numpy dtype
--
You received this message because you are subscribed to the Google Groups "Numba Public Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numba-users+unsubscribe@continuum.io.
To post to this group, send email to numba...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/numba-users/f7a28bf0-a2d0-47fd-8fe6-8662dabfcaf1%40continuum.io.
NumPy's vectorize decorator can handle a tuple of returns, but Numba's cannot yet.I think the only workaround in this case is to write a @jit function for now.
On Fri, Apr 28, 2017 at 3:04 PM, Gil Forsyth <gilfo...@gmail.com> wrote:
Hi Gideon,
When you create a ufunc using vectorize, Numba looks at the inputs and output as scalars and then generates the loop to allow it to operate on NumPy arrays. I don't think you can have multiple outputs in this case, as various ufunc builtins won't make a lot of sense (like accumulate, etc...)
These will work find as two separate calls, one for the cos and one for the sin
On Friday, April 28, 2017 at 1:31:38 PM UTC-4, Gideon Simpson wrote:I'm trying to use @vectorize on a function which takes two arguments and returns two arguments, i.e.:however, when I try to use it, I get:
@numba.vectorize(nopython=True)def test(x,y):f = np.cos(x+y)g = np.sin(x*y)return f,g
NotImplementedError: (float64 x 2) cannot be represented as a Numpy dtype
How can I get the desired behavior? I'm using 0.32
--
You received this message because you are subscribed to the Google Groups "Numba Public Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numba-users...@continuum.io.
To post to this group, send email to numba...@continuum.io.
@numba.njit()
def test(x,y):
f = np.cos(x+y)
g = np.sin(x*y)
return f,g