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

Errors in TreeSA() #18

Closed
ChenZhao44 opened this issue Nov 15, 2021 · 1 comment
Closed

Errors in TreeSA() #18

ChenZhao44 opened this issue Nov 15, 2021 · 1 comment

Comments

@ChenZhao44
Copy link
Collaborator

Here is a MWE.

julia> using OMEinsum, OMEinsumContractionOrders

julia> ec = EinCode([[1],[2],[2],[1]], Int[])
1, 2, 2, 1 -> 

julia> ts = [rand(2) for _ = 1:4];

julia> optimize_code(ec, uniformsize(ec, 2), TreeSA())
ERROR: MethodError: Cannot `convert` an object of type 
  NestedEinsum{OMEinsum.DynamicEinCode{Int64}} to an object of type 
  NestedEinsum{OMEinsum.DynamicEinCode{Union{}}}
Closest candidates are:
  convert(::Type{T}, ::T) where T at essentials.jl:205
Stacktrace:
  [1] setindex!(A::Vector{NestedEinsum{OMEinsum.DynamicEinCode{Union{}}}}, x::NestedEinsum{OMEinsum.DynamicEinCode{Int64}}, i1::Int64)
    @ Base ./array.jl:843
  [2] _unsafe_copyto!(dest::Vector{NestedEinsum{OMEinsum.DynamicEinCode{Union{}}}}, doffs::Int64, src::Vector{NestedEinsum{OMEinsum.DynamicEinCode{Int64}}}, soffs::Int64, n::Int64)
    @ Base ./array.jl:235
  [3] unsafe_copyto!
    @ ./array.jl:289 [inlined]
  [4] _copyto_impl!
    @ ./array.jl:313 [inlined]
  [5] copyto!
    @ ./array.jl:299 [inlined]
  [6] copyto!
    @ ./array.jl:325 [inlined]
  [7] copyto_axcheck!
    @ ./abstractarray.jl:1056 [inlined]
  [8] Vector{NestedEinsum{OMEinsum.DynamicEinCode{Union{}}}}(x::Vector{NestedEinsum{OMEinsum.DynamicEinCode{Int64}}})
    @ Base ./array.jl:540
  [9] convert
    @ ./array.jl:532 [inlined]
 [10] NestedEinsum(args::Tuple{NestedEinsum{OMEinsum.DynamicEinCode{Int64}}, NestedEinsum{OMEinsum.DynamicEinCode{Int64}}}, eins::OMEinsum.DynamicEinCode{Union{}})
    @ OMEinsum ~/.julia/packages/OMEinsum/MTnLO/src/einsequence.jl:166
 [11] _nestedeinsum(tree::OMEinsumContractionOrders.ExprTree, lbs::Dict{Int64, Int64})
    @ OMEinsumContractionOrders ~/.julia/packages/OMEinsumContractionOrders/jLE2Q/src/treesa.jl:312
 [12] NestedEinsum
    @ ~/.julia/packages/OMEinsumContractionOrders/jLE2Q/src/treesa.jl:308 [inlined]
 [13] optimize_tree(code::OMEinsum.DynamicEinCode{Int64}, size_dict::Dict{Int64, Int64}; sc_target::Int64, βs::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, ntrials::Int64, niters::Int64, sc_weight::Float64, rw_weight::Float64, initializer::Symbol, greedy_method::MinSpaceOut, greedy_nrepeat::Int64)
    @ OMEinsumContractionOrders ~/.julia/packages/OMEinsumContractionOrders/jLE2Q/src/treesa.jl:96
 [14] _optimize_code
    @ ~/.julia/packages/OMEinsumContractionOrders/jLE2Q/src/interfaces.jl:43 [inlined]
 [15] optimize_code
    @ ~/.julia/packages/OMEinsumContractionOrders/jLE2Q/src/interfaces.jl:22 [inlined]
 [16] optimize_code(code::OMEinsum.DynamicEinCode{Int64}, size_dict::Dict{Int64, Int64}, optimizer::TreeSA{Int64, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, GreedyMethod{MinSpaceOut}})
    @ OMEinsumContractionOrders ~/.julia/packages/OMEinsumContractionOrders/jLE2Q/src/interfaces.jl:21
 [17] top-level scope
    @ REPL[62]:1
@GiggleLiu
Copy link
Member

GiggleLiu commented Nov 15, 2021

Thanks for the bug report.
It is an issue already fixed in master, so I will tag a new version, it will fix this issue.

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

No branches or pull requests

2 participants