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