Unverified Commit 5c76e47f authored by Hongyi ZHANG's avatar Hongyi ZHANG Committed by GitHub
Browse files

[Docs] fix ffi docs (#4248)


Co-authored-by: default avatarMinjie Wang <wmjlyjemaine@gmail.com>
parent 20fe9397
......@@ -24,11 +24,13 @@ API that is exposed to python is only a few lines of codes:
#include <dgl/runtime/packed_func.h>
#include <dgl/runtime/registry.h>
using namespace dgl::runtime;
DGL_REGISTER_GLOBAL("calculator.MyAdd")
.set_body([] (DGLArgs args, DGLRetValue* rv) {
int a = args[0];
int b = args[1];
*rv = a * b;
*rv = a + b;
});
Compile and build the library. On the python side, create a
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment