rbc
rbc copied to clipboard
Can we specify Numpy array as the input?
I saw this example in the README.md
@rjit('double(double, double)', 'int(int, int)')
def add(x, y):
return x + y
Is it possible to rjit a function that has Numpy array inputs?
i.e. something like
@rjit('double[:](double[:], double[:])')
def add(x, y):
return x + y
Yes, in principle. The rjit signature should read rjit('double[](double[], double[])').
For the heavydb backend, see test cases in https://github.com/heavyai/rbc/blob/main/rbc/tests/heavydb/test_array_math.py, for instance.
For the numpy backend, I am sure it can be made to work.