Skip to content

Commit 6850a94

Browse files
authored
[FFI][Fix] Update datatype registry calls to the new paths (#18208)
1 parent 60f5568 commit 6850a94

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

python/tvm/target/datatype.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
BinaryOpExpr as _BinaryOpExpr,
2727
)
2828
from tvm.tir.op import call_pure_extern
29+
from tvm.ffi import get_global_func
2930
from tvm.ffi import register_func as _register_func
3031
from tvm.tir import call_intrin
3132

@@ -55,7 +56,7 @@ def register(type_name, type_code):
5556
The type's code, which should be >= kCustomBegin. See
5657
include/tvm/runtime/data_type.h.
5758
"""
58-
tvm.runtime._ffi_api._datatype_register(type_name, type_code)
59+
get_global_func("dtype.register_custom_type")(type_name, type_code)
5960

6061

6162
def get_type_name(type_code):
@@ -82,7 +83,7 @@ def get_type_name(type_code):
8283
The name of the custom datatype.
8384
8485
"""
85-
return tvm.runtime._ffi_api._datatype_get_type_name(type_code)
86+
return get_global_func("dtype.get_custom_type_name")(type_code)
8687

8788

8889
def get_type_code(type_name):
@@ -108,7 +109,7 @@ def get_type_code(type_name):
108109
type_code : int
109110
The type code of the custom datatype.
110111
"""
111-
return tvm.runtime._ffi_api._datatype_get_type_code(type_name)
112+
return get_global_func("dtype.get_custom_type_code")(type_name)
112113

113114

114115
def get_type_registered(type_code):

0 commit comments

Comments
 (0)