Hi, I am learning how to use csrmm topi but have encountered above error with the following code:
with tvm.target.Target('llvm'):
ctx = tvm.context(tgt, 0)
A = tvm.contrib.sparse.placeholder((3, 3), name='A')
B = te.placeholder((3, 5), name='B')
D = topi.sparse.csrmm(A, B)
s = te.create_schedule(D.op)
# print(tvm.lower(s, [A.data, A.indices, A.indptr, B, D], simple_mode=True))
fcsrmm = tvm.build(s, [A.data, A.indices, A.indptr, B, D], tgt, target_host=tgt_host, name='csrmm')
# run
ctx = tvm.context(tgt, 0)
a = tvm.contrib.sparse.array(np.diag([1, 2, 3]), ctx)
b = tvm.nd.array(np.random.uniform(size=(3, 5)), ctx)
d = tvm.nd.array(np.zeros((3, 5)), ctx)
# this triggers the above error
fcsrmm(a.data. a.indices, a.indptr, b, d)
And got error for the last line and there is no detailed call stacks in the error:
Traceback (most recent call last): File “sample_conv.py”, line 56, in fcsrmm(a.data. a.indices, a.indptr, b, d) AttributeError: ‘NDArray’ object has no attribute ‘a’
Process finished with exit code 1
so I don’t know what went wrong and how to deal with it. Any help will be appreciated, thanks.