Jutho / TensorOperations.jl

Julia package for tensor contractions and related operations
https://jutho.github.io/TensorOperations.jl/stable/
Other
453 stars 56 forks source link

Unsupported assignment operator ":=" #106

Closed ParadaCarleton closed 3 years ago

ParadaCarleton commented 3 years ago

I'm getting the following weird error:

ERROR: LoadError: LoadError: syntax: unsupported assignment operator ":="

The relevant line:

    @tensoropt pointwise_loo[i] := weights[i, j, k] * exp(log_likelihood[i, j, k]) |> log

I'm very confused by this since the README notes that a new array can be created using :=.

Jutho commented 3 years ago

That's a weird error indeed, but the problem is mostly that this kind of operations are not allowed with TensorOperations.jl. TensorOperations is rather strict and only can do tensor contractions and additions, not things like pointwise exponentials and logarithms as you try to do here. Maybe Tullio.jl can be of more assistance for your use case.