I am trying to build the TVM from source on my machine(CentOS Linux release 7.7.1908),after compiled done, When I run the test cases below
import tvm import time import timeit import numpy as np from matplotlib import pyplot as plt print(tvm. version )
def vector_add(n): “”“TVM expression for vector add”"" A = tvm.placeholder((n,), name=‘a’) B = tvm.placeholder((n,), name=‘b’) C = tvm.compute(A.shape, lambda i: A[i] + B[i], name=‘c’) return A, B, C
n = 20 A, B, C = vector_add(n)
type(A), type©
it raise an error AttributeError Traceback (most recent call last) in 15 16 n = 20 —> 17 A, B, C = vector_add(n) 18 19 type(A), type©
in vector_add(n) 9 def vector_add(n): 10 “”“TVM expression for vector add”"" —> 11 A = tvm.placeholder((n,), name=‘a’) 12 B = tvm.placeholder((n,), name=‘b’) 13 C = tvm.compute(A.shape, lambda i: A[i] + B[i], name=‘c’)
my compile config: llvm version 9.0.0,all package except unit test tvm config set(USE_LLVM ON) set(USE_CUDA ON)
and after compile and add follow script to my bashrc export TVM_HOME=/path/myown/tvm export PYTHONPATH=$TVM_HOME/python:$TVM_HOME/topi/python:${PYTHONPATH}
i am newer to tvm, i also try to find some solutions from Baidu/Google but there is no gain