AttributeError: module 'tvm' has no attribute 'testing'

Hi, all!

I met an error report:

AttributeError: module 'tvm' has no attribute 'testing'

in the ‘tutorials/language/tensorize.py’

tvm.testing.assert_allclose(c.asnumpy(), np.dot(a, b.T), rtol=1e-3)



My tvm code is:

commit 98c2096f4944bdbdbbb2b7b20ccd35c6c11dfbf6
Date:   Fri Oct 9 11:44:09 2020 -0700



Actually, use numpy’s testing method can fix it, like:

np.testing.assert_allclose(c.asnumpy(), np.dot(a, b.T), rtol=1e-3)

But I wonder if I miss some code of ‘tvm.testing’ in my code?

Thanks, Pei Mu

Looks like many of the tutorials were missing an import tvm.testing statement. I’ve submitted a PR for this here: https://github.com/apache/tvm/pull/7248. If you’d like to fix this locally, you can add an import tvm.testing to the top of the tutorials/language/tensorize.py.

1 Like

Thanks tkonolige, that fixed!