d2l-ai / d2l-tvm

Dive into Deep Learning Compiler
https://tvm.d2l.ai
630 stars 97 forks source link

typo #35

Closed zarzen closed 4 years ago

zarzen commented 4 years ago

https://github.com/d2l-ai/d2l-tvm/blob/master/chapter_expressions/index_shape_expressions.md

p, q = te.var('p'), te.var('q')
B = te.compute((p, q), lambda i, j: A[(i*q+j)//m, (i*q+j)%m], name='b')

m should be p

yidawang commented 4 years ago

Please submit a PR to fix it. Thanks! @zarzen

Ca0L commented 4 years ago

I think A[(i*q+j)//m, (i*q+j)%m] is correct since elements are taken from A whose shape is (n, m). The index in the square bracket should be relative to A.

yidawang commented 4 years ago

@Ca0L Yes, you are right. Thanks for pointing it out. @zarzen Can you double check and send another PR to revert the change if you agree with @Ca0L ? Sorry for the confusion.

zarzen commented 4 years ago

sorry for the confusion, I am wrong. @Ca0L Thanks for correcting!