1414# KIND, either express or implied. See the License for the
1515# specific language governing permissions and limitations
1616# under the License.
17- """FFI for C++ TOPI ops and schedules"""
17+ """Load Lib for C++ TOPI ops and schedules"""
1818import sys
1919import os
2020import ctypes
21- from imp import new_module as _new_module
21+
2222from tvm ._ffi .function import _init_api_prefix
2323from tvm ._ffi import libinfo
2424
@@ -42,27 +42,3 @@ def _load_lib():
4242_LIB , _LIB_NAME = _load_lib ()
4343
4444_init_api_prefix ("topi.cpp" , "topi" )
45-
46- def _create_module (name ):
47- fullname = __name__ + "." + name
48- mod = _new_module (fullname )
49- sys .modules [fullname ] = mod
50- return mod
51-
52- # pylint: disable-msg=C0103
53- nn = _create_module ("nn" )
54- _init_api_prefix ("topi.cpp.nn" , "topi.nn" )
55- generic = _create_module ("generic" )
56- _init_api_prefix ("topi.cpp.generic" , "topi.generic" )
57- cuda = _create_module ("cuda" )
58- _init_api_prefix ("topi.cpp.cuda" , "topi.cuda" )
59- rocm = _create_module ("rocm" )
60- _init_api_prefix ("topi.cpp.rocm" , "topi.rocm" )
61- x86 = _create_module ("x86" )
62- _init_api_prefix ("topi.cpp.x86" , "topi.x86" )
63- vision = _create_module ("vision" )
64- _init_api_prefix ("topi.cpp.vision" , "topi.vision" )
65- yolo = _create_module ("vision.yolo" )
66- _init_api_prefix ("topi.cpp.vision.yolo" , "topi.vision.yolo" )
67- image = _create_module ("image" )
68- _init_api_prefix ("topi.cpp.image" , "topi.image" )
0 commit comments