@@ -47,7 +47,7 @@ y = np.empty_like(x)
4747mod.add_one_cpu(x, y)
4848```
4949
50- In this case, ` tvm_ffi.load_module ` will return a ` tvm_ffi.Module ` class that contains
50+ In this case, {py : func } ` tvm_ffi.load_module ` will return a {py : class } ` tvm_ffi.Module ` class that contains
5151the exported functions. You can access the functions by their names.
5252
5353## Tensor
@@ -67,12 +67,12 @@ np_result = np.from_dlpack(tvm_array)
6767
6868In most cases, however, you do not have to explicitly create Tensors.
6969The Python interface can take in ` torch.Tensor ` and ` numpy.ndarray ` objects
70- and automatically convert them to ` tvm_ffi.Tensor ` .
70+ and automatically convert them to {py : class } ` tvm_ffi.Tensor ` .
7171
7272## Functions and Callbacks
7373
74- ` tvm_ffi.Function ` provides the Python interface for ` ffi::Function ` in the C++.
75- You can retrieve globally registered functions via ` tvm_ffi.get_global_func() ` .
74+ {py : class } ` tvm_ffi.Function ` provides the Python interface for ` ffi::Function ` in the C++.
75+ You can retrieve globally registered functions via {py : func } ` tvm_ffi.get_global_func ` .
7676
7777``` python
7878import tvm_ffi
@@ -84,8 +84,8 @@ assert fecho(1) == 1
8484```
8585
8686You can pass a Python function as an argument to another FFI function as callbacks.
87- Under the hood, ` tvm_ffi.convert ` is called to convert the Python function into a
88- ` tvm_ffi.Function ` .
87+ Under the hood, {py : func } ` tvm_ffi.convert ` is called to convert the Python function into a
88+ {py : class } ` tvm_ffi.Function ` .
8989
9090``` python
9191import tvm_ffi
@@ -103,7 +103,7 @@ You can also register a Python callback as a global function.
103103``` python
104104import tvm_ffi
105105
106- @tvm_ffi.register_func (" example.add_one" )
106+ @tvm_ffi.register_global_func (" example.add_one" )
107107def add_one (a ):
108108 return a + 1
109109
@@ -112,7 +112,7 @@ assert tvm_ffi.get_global_func("example.add_one")(1) == 2
112112
113113## Container Types
114114
115- When an FFI function takes arguments from lists/tuples, they will be converted into ` tvm_ffi.Array ` .
115+ When an FFI function takes arguments from lists/tuples, they will be converted into {py : class } ` tvm_ffi.Array ` .
116116
117117``` python
118118import tvm_ffi
@@ -124,7 +124,7 @@ assert len(arr) == 4
124124assert arr[0 ] == 1
125125```
126126
127- Dictionaries will be converted to ` tvm_ffi.Map `
127+ Dictionaries will be converted to {py : class } ` tvm_ffi.Map `
128128
129129``` python
130130import tvm_ffi
@@ -167,7 +167,7 @@ File "src/ffi/extra/testing.cc", line 60, in void tvm::ffi::TestRaiseError(tvm::
167167 throw ffi::Error(kind, msg, TVMFFITraceback(__FILE__, __LINE__, TVM_FFI_FUNC_SIG, 0));
168168```
169169
170- We register common error kinds. You can also register extra error dispatch via the ` tvm_ffi.register_error ` function.
170+ We register common error kinds. You can also register extra error dispatch via the {py : func } ` tvm_ffi.register_error ` function.
171171
172172## Advanced: Register Your Own Object
173173
@@ -239,5 +239,5 @@ assert test_int_pair.b == 2
239239Under the hood, we leverage the information registered through the reflection registry to
240240generate efficient field accessors and methods for each class.
241241
242- Importantly, when you have multiple inheritance, you need to call ` tvm_ffi.register_object `
242+ Importantly, when you have multiple inheritance, you need to call {py : func } ` tvm_ffi.register_object `
243243on both the base class and the child class.
0 commit comments