tensor-compiler / taco

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

Fixing index #193

Open jcrbloch opened 5 years ago

jcrbloch commented 5 years ago

Is it possible to fix an index to an "external" value when performing a contraction. An example would be: y(i) = A(i,j) * x(j,k) where k would have some fixed value. I don't want to include the index k in the tensor y for storage reasons.

oicirtap commented 5 years ago

Just to clarify, in your expression, you want to access a vector slice of x and perform Matrix vector multiplication? Say, having k=0 for example? If so, we are currently working on enabling tensor slices for operations as part of our proposed new API. It is not currently supported though.

Does this answer your question?

jcrbloch commented 5 years ago

That is almost what I need, but not exactly, I need a tensor-tensor contraction where I want to keep one or more indices of the input tensors fixed. In other words, some of the input tensors are implicitly of used as tensors of lower order.

On 6. Feb 2019, at 21:22, Patricio Noyola notifications@github.com wrote:

Just to clarify, in your expression, you want to access a vector slice of x and perform Matrix vector multiplication? Say, having k=0 for example? If so, we are currently working on enabling tensor slices for operations as part of our proposed new API. It is not currently supported though.

Does this answer your question?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jcrbloch commented 5 years ago

In more detail, I am looking for something like:

C(x1,x2) = A(x1,y1,z1,i1,i2) * B(x2,y2,z2,i1,i2)

In this example I am contracting A and B over i1 and i2 to construct a tensor with external indices x1 and x2, but for fixed values of y1,z1,y2,z2.