Unintended contraction throws error.
As a disclaimer, there might be a simple way to achieve this, I am not an expert in tensor contractions or TensorOperations.jl, but I could not find a solution easily. The following code
R = rand(2, 3)
M = rand(2, 5)
@tensor begin
C[t,n,m] := R[t,n]*M[t,m]
end
throws an error with "non-matching indices between left and right hand side: ..." here. The intention here is to not contract t on the right hand side (which is what I found the parser decides to do after inspecting its error condition), but to rather iterate over all t and expand it in C. torch.einsum can handle this example as can Tullio.
I don't think this is supported.
It's just broadcasting, C = R .* reshape(M, 2, 1, 5), which if you like index notation, TensorCast.jl will write for you. For simple things this is a relatively lightweight option, and complementary to TensorOperations.jl.
As indeed indicated by @mcabbott , this behaviour is not supported with TensorOperations.jl, which is more strict in the index notation it supports as compared to einsum and Tullio. As I don't think this will change in the short run, I will close this issue.