Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't include constants in expression #91

Closed
ssfrr opened this issue Feb 26, 2020 · 2 comments
Closed

Can't include constants in expression #91

ssfrr opened this issue Feb 26, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@ssfrr
Copy link

ssfrr commented Feb 26, 2020

It seems that the @ein macro doesn't like having constants included. Interestingly it seems to throw a different error depending on whether you're multiplying or adding.

x = rand(10, 10)
@ein y[i] := x[i, j] * 2

Gives:

LoadError: type Nothing has no field inds
in expression starting at /home/sfr/research_journal/2020/02/26/spatial_subspace_sdr.jmd:177
getproperty(::Nothing, ::Symbol) at Base.jl:20
(::OMEinsum.var"#78#80")(::Nothing) at einsequence.jl:147
...
x = rand(10, 10)
@ein y[i] := x[i, j] + 2

gives

LoadError: type Nothing has no field iy
in expression starting at /home/sfr/research_journal/2020/02/26/spatial_subspace_sdr.jmd:177
getproperty(::Nothing, ::Symbol) at Base.jl:20
#_nested_ein_macro#74(::Symbol, ::typeof(OMEinsum._nested_ein_macro), ::Expr) at einsequence.jl:136
_nested_ein_macro at einsequence.jl:121 [inlined]
#_ein_macro#69(::Symbol, ::typeof(OMEinsum._ein_macro), ::Expr) at interfaces.jl:157
...
@under-Peter
Copy link
Owner

Addition is actually not supported so we probably should throw an error there (not sure what happens under the hood there but I'll look at it).

The issue with the constant is a bit unfortunate and it should probably work.

@under-Peter under-Peter added the bug Something isn't working label Feb 27, 2020
@GiggleLiu GiggleLiu added enhancement New feature or request and removed bug Something isn't working labels Sep 23, 2021
@GiggleLiu
Copy link
Collaborator

I do not think we will have scalar in the einsum expression in near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants