import tvm
@tvm.hybrid.script
def test(a, b, val):
for i in range(a.shape[0]):
b[i] = a[i] * val
return b
if __name__ == '__main__':
a_plc = tvm.placeholder((5,))
b_plc = tvm.placeholder((5,))
val_v = tvm.const(0.5, dtype="float32")
c = test(a_plc, b_plc, val_v)
print(c)
returns following error:
Traceback (most recent call last):
File "test_tvm_ssd.py", line 20, in <module>
c = test(a_plc, b_plc, val_v)
File "<decorator-gen-130>", line 2, in test
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-macosx-10.11-x86_64.egg/tvm/hybrid/api.py", line 25, in wrapped_func
if _is_tvm_arg_types(args):
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-macosx-10.11-x86_64.egg/tvm/hybrid/util.py", line 54, in _is_tvm_arg_types
raise ValueError("Expect a Var or Tensor instance but % get!" % str(type(elem)))
TypeError: must be real number, not str