Skip to content

Add doesn't broadcast #214

@ojwoodford

Description

@ojwoodford

MWE:

using TensorOperations

function test_tensor()
    A = rand(2, 2, 3)
    B = rand(2, 4)
    C = rand(2, 3)
    @tensor D[i,j,k] := A[i,l,k] * B[l,j] + C[i,k]
end

test_tensor()

ERROR: TensorOperations.IndexError{String}("add: (:i, :k) to (:i, :j, :k))")

I was expecting this to work, and for the values in C to be broadcast across the rows (dim 2) of D. Is there a reason why it doesn't?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions