Commit 0e6370db by Tianqi Chen Committed by GitHub

explicit import testing (#956)

* explicit import testing

* Enable init api for extension modules
parent e6d1c628
......@@ -280,15 +280,23 @@ def _get_api(f):
return flocal(*args)
return my_api_func
def _init_api(namespace):
def _init_api(namespace, target_module_name=None):
"""Initialize api for a given module name
mod : str
The name of the module.
namespace : str
The namespace of the source registry
target_module_name : str
The target module name if different from namespace
"""
assert namespace.startswith("tvm.")
target_module_name = (
target_module_name if target_module_name else namespace)
if namespace.startswith("tvm."):
prefix = namespace[4:]
_init_api_prefix(namespace, prefix)
_init_api_prefix(target_module_name, namespace[4:])
else:
_init_api_prefix(target_module_name, namespace)
def _init_api_prefix(module_name, prefix):
module = sys.modules[module_name]
......
......@@ -3,6 +3,7 @@ import os
import numpy as np
import tvm
import topi
import topi.testing
from tvm.contrib.pickle_memoize import memoize
from topi.util import get_const_tuple
......
......@@ -3,6 +3,7 @@ import os
import numpy as np
import tvm
import topi
import topi.testing
from tvm.contrib.pickle_memoize import memoize
from topi.util import get_const_tuple
......
......@@ -3,6 +3,7 @@ import os
import numpy as np
import tvm
import topi
import topi.testing
from tvm.contrib.pickle_memoize import memoize
from topi.util import get_const_tuple
......
......@@ -2,6 +2,7 @@
import numpy as np
import tvm
import topi
import topi.testing
from tvm.contrib.pickle_memoize import memoize
from topi.util import get_const_tuple
......
......@@ -2,6 +2,7 @@
import numpy as np
import tvm
import topi
import topi.testing
from topi.util import get_const_tuple
from tvm.contrib.pickle_memoize import memoize
......
import tvm
import topi
import topi.testing
import numpy as np
from scipy import signal
from topi.util import get_const_tuple
......
......@@ -5,6 +5,7 @@ from tvm.contrib.pickle_memoize import memoize
from scipy import signal
from topi.util import get_const_tuple
from topi.nn.util import get_pad_tuple
import topi.testing
from topi.cuda.depthwise_conv2d import schedule_depthwise_conv2d_backward_input_nhwc
......
import tvm
import topi
import topi.testing
import numpy as np
from tvm.contrib.pickle_memoize import memoize
from scipy import signal
......
import numpy as np
import tvm
import topi
import topi.testing
from topi import util
......
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