I’m interested in writing some custom external functions that return DLTensors, however I’m having issues with the python interface as the function always returns a c_void_p object. Here’s a simple sample of some code that demonstrates the problem.
void simple_test(TVMArgs args, TVMRetValue* rv) {
DLTensor* input = args[0]'
*rv = input;
}
TVM_REGISTER_GLOBAL("tvm.contrib.test.simple_test").set_body(simple_test)
From python I call the function as follows:
my_func = tvm.get_global_func("tvm.contrib.test.simple_test")
test_input = tvm.nd.array(np.array([1, 2, 3]))
test_output = my_func(test_input)
Examining test_output shows its a void pointer rather than an ndarray like I expect. What am I doing wrong here?