tensor-compiler / taco

The Tensor Algebra Compiler (taco) computes sparse tensor expressions on CPUs and GPUs
http://tensor-compiler.org
Other
1.25k stars 188 forks source link

Tensor broadcast #6

Open fredrikbk opened 7 years ago

fredrikbk commented 7 years ago
taco "A(i,j) = b(i)"
Error at /Users/fred/Dropbox/projects/tensor-compiler/taco/src/tensor.cpp:524 in setExpr:
 All variables must appear on the right-hand-side of an assignment. This restriction will be removed in the future.
Expression: A(i,j) = b(i)
Abort trap: 6
fredrikbk commented 7 years ago

The second loop in this expression (j) has an empty merge rule, because no inputs index into j. However, we must still iterate over j to copy b(i) into each column A(i,*). This loop must be dense.

Thus the rule: Empty merge rules mean dense iteration. But we need some way to say what dimension the dense iteration is over.