bsc-quantic / deltaarrays.jl Goto Github PK
View Code? Open in Web Editor NEWn-dimensional diagonal arrays for Julia
License: Apache License 2.0
n-dimensional diagonal arrays for Julia
License: Apache License 2.0
I am encountering an error ambiguity when I try to perform a contraction between a DeltaArray
and a regular Array
using the OMEinsum
package. The error occurs when I use the einsum
function:
julia> using DeltaArrays
julia> using OMEinsum
julia> darray = DeltaArray{3}(rand(2))
2×2×2 DeltaArray{Float64, 3, Vector{Float64}}:
[:, :, 1] =
0.790413 0.0
0.0 0.0
[:, :, 2] =
0.0 0.0
0.0 0.0187643
julia> array2 = rand(2, 2, 2)
2×2×2 Array{Float64, 3}:
[:, :, 1] =
0.352157 0.502972
0.474538 0.702706
[:, :, 2] =
0.332013 0.730828
0.407898 0.403412
julia> contracted = ein"ijk,jlm->iklm"(darray,array2)
ERROR: MethodError: similar(::DeltaArray{Float64, 3, Vector{Float64}}, ::Type{Float64}, ::Tuple{Int64, Int64, Int64}) is ambiguous. Candidates:
similar(a::AbstractArray, ::Type{T}, dims::Tuple{Vararg{Int64, N}}) where {T, N} in Base at abstractarray.jl:806
similar(a::AbstractArray, ::Type{T}, dims::Tuple{Integer, Vararg{Integer}}) where T in Base at abstractarray.jl:804
similar(a::AbstractArray, ::Type{T}, dims::Tuple{Union{Integer, Base.OneTo}, Vararg{Union{Integer, Base.OneTo}}}) where T in Base at abstractarray.jl:803
similar(::DeltaArray, ::Type{T}, dims) where T in DeltaArrays at /home/jofrevalles/.julia/packages/DeltaArrays/xu4Xt/src/DeltaArrays.jl:159
Possible fix, define
similar(::DeltaArray, ::Type{T}, ::Tuple{Int64, Vararg{Int64, N}}) where {T, N}
Stacktrace: ...
This error suggests that there is ambiguity in the similar
method for DeltaArray
. The error suggests the following possible fix:
similar(::DeltaArray, ::Type{T}, ::Tuple{Int64, Vararg{Int64, N}}) where {T, N}
I think it would be a good idea to implement this to allow for operations between DeltaArray
s and regular Array
s, what do you think?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.