diff --git a/src/relay/transforms/fold_constant.cc b/src/relay/transforms/fold_constant.cc index 0ecbfea8c905..7273c28a0e93 100644 --- a/src/relay/transforms/fold_constant.cc +++ b/src/relay/transforms/fold_constant.cc @@ -177,20 +177,6 @@ class ConstantFolder : public ExprMutator { const Op& cast_op_; const Op& ndarray_size_op_; - // Create an interpreter. - FInterpreter GetInterpreter(const IRModule& mod) { - using tvm::transform::PassContext; - DLContext ctx; - ctx.device_type = kDLCPU; - ctx.device_id = 0; - Target target = Target::Create("llvm"); - // use a fresh build context - // in case we are already in a build context. - With fresh_build_ctx(PassContext::Create()); - - return CreateInterpreter(mod, ctx, target); - } - // Convert value to expression. Expr ObjectToExpr(const ObjectRef& value) { if (value->IsInstance()) { @@ -230,7 +216,17 @@ class ConstantFolder : public ExprMutator { auto entry_func = Downcast(mod->Lookup("main")); expr = expr.as() == nullptr ? entry_func->body : entry_func; - FInterpreter executor = GetInterpreter(mod); + using tvm::transform::PassContext; + DLContext ctx; + ctx.device_type = kDLCPU; + ctx.device_id = 0; + Target target = Target::Create("llvm"); + // use a fresh build context + // in case we are already in a build context. + // needed for both execution and creation(due to JIT) + With fresh_build_ctx(PassContext::Create()); + + FInterpreter executor = CreateInterpreter(mod, ctx, target); return ObjectToExpr(executor(expr)); } diff --git a/tests/scripts/task_python_docs.sh b/tests/scripts/task_python_docs.sh index c239abb7bc9d..29166c627663 100755 --- a/tests/scripts/task_python_docs.sh +++ b/tests/scripts/task_python_docs.sh @@ -18,6 +18,7 @@ set -e set -u +set -o pipefail source tests/scripts/setup-pytest-env.sh @@ -48,7 +49,7 @@ make cython3 cd docs PYTHONPATH=`pwd`/../python make html |& tee /tmp/$$.log.txt -if grep -E "failed to execute" < /tmp/$$.log.txt; then +if grep -E "failed to execute|Segmentation fault" < /tmp/$$.log.txt; then echo "Some of sphinx-gallery item example failed to execute." exit 1 fi diff --git a/vta/tutorials/frontend/deploy_detection.py b/vta/tutorials/frontend/legacy/deploy_detection.py similarity index 100% rename from vta/tutorials/frontend/deploy_detection.py rename to vta/tutorials/frontend/legacy/deploy_detection.py