From 39895bfe042ab6d2fad525940b35515594ccba57 Mon Sep 17 00:00:00 2001 From: Tristan Konolige Date: Mon, 11 Jan 2021 14:00:16 -0800 Subject: [PATCH] [FIX,TUTORIALS] Import tvm.testing in tutorials that use it (#7248) --- tutorials/autotvm/tune_conv2d_cuda.py | 1 + tutorials/autotvm/tune_simple_template.py | 3 ++- tutorials/frontend/using_external_lib.py | 1 + tutorials/get_started/relay_quick_start.py | 1 + tutorials/language/extern_op.py | 1 + tutorials/language/tensorize.py | 1 + tutorials/optimize/opt_matmul_auto_tensorcore.py | 1 + 7 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tutorials/autotvm/tune_conv2d_cuda.py b/tutorials/autotvm/tune_conv2d_cuda.py index c32049567679a..dc8e6e522249d 100644 --- a/tutorials/autotvm/tune_conv2d_cuda.py +++ b/tutorials/autotvm/tune_conv2d_cuda.py @@ -55,6 +55,7 @@ import tvm from tvm import te, topi, testing from tvm.topi.testing import conv2d_nchw_python +import tvm.testing from tvm import autotvm diff --git a/tutorials/autotvm/tune_simple_template.py b/tutorials/autotvm/tune_simple_template.py index d7d43c794cdae..bd2dcf3cfd1e3 100644 --- a/tutorials/autotvm/tune_simple_template.py +++ b/tutorials/autotvm/tune_simple_template.py @@ -59,7 +59,8 @@ import numpy as np import tvm -from tvm import te, testing +from tvm import te +import tvm.testing # the module is called `autotvm` from tvm import autotvm diff --git a/tutorials/frontend/using_external_lib.py b/tutorials/frontend/using_external_lib.py index a150b683a5318..8e7fcd70e3e9a 100644 --- a/tutorials/frontend/using_external_lib.py +++ b/tutorials/frontend/using_external_lib.py @@ -37,6 +37,7 @@ from tvm.contrib import graph_runtime as runtime from tvm import relay from tvm.relay import testing +import tvm.testing ###################################################################### # Create a simple network diff --git a/tutorials/get_started/relay_quick_start.py b/tutorials/get_started/relay_quick_start.py index 6da62f5ced4b0..444b915ca7c8f 100644 --- a/tutorials/get_started/relay_quick_start.py +++ b/tutorials/get_started/relay_quick_start.py @@ -44,6 +44,7 @@ import tvm from tvm import te from tvm.contrib import graph_runtime +import tvm.testing ###################################################################### # Define Neural Network in Relay diff --git a/tutorials/language/extern_op.py b/tutorials/language/extern_op.py index 454237a337832..794101a4fb569 100644 --- a/tutorials/language/extern_op.py +++ b/tutorials/language/extern_op.py @@ -35,6 +35,7 @@ from tvm import te import numpy as np from tvm.contrib import cblas +import tvm.testing if not tvm.get_global_func("tvm.contrib.cblas.matmul", allow_missing=True): raise Exception("Not compiled with cblas support; can't build this tutorial") diff --git a/tutorials/language/tensorize.py b/tutorials/language/tensorize.py index e91cfe43ab463..a75b78b65ca44 100644 --- a/tutorials/language/tensorize.py +++ b/tutorials/language/tensorize.py @@ -36,6 +36,7 @@ import tvm from tvm import te +import tvm.testing import numpy as np ###################################################################### diff --git a/tutorials/optimize/opt_matmul_auto_tensorcore.py b/tutorials/optimize/opt_matmul_auto_tensorcore.py index d81eca56210e0..f5450b9524c60 100644 --- a/tutorials/optimize/opt_matmul_auto_tensorcore.py +++ b/tutorials/optimize/opt_matmul_auto_tensorcore.py @@ -50,6 +50,7 @@ from tvm import autotvm from tvm.contrib import nvcc +import tvm.testing def matmul_nn(A, B, L, dtype="float16", layout="NN"):