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

val{:symbol} fixes #68

Closed montyvesselinov closed 5 years ago

montyvesselinov commented 5 years ago

I think this fixes errors i am currently getting running the code

Jutho commented 5 years ago

Could you please elaborate on the errors you are currently getting?

montyvesselinov commented 5 years ago

function similar_from_indices expects the last argument to be val{:symbol} not :symbol

Jutho commented 5 years ago

As you can see from the red cross next to your commit, this changes breaks all tests, whereas the code you did change was tested and worked correctly before.

Could you please elaborate on what error you obtain, which versions of Julia and TensorOperations you are using, and possibly a minimal working example of these errors.

These lines of code cannot be the problem and this change is not the solution.

montyvesselinov commented 5 years ago

In my julia domain, I got mixed up working with the TensorOperations source code of the 0.7.1 version and the latest version at the same time. All is ok now. Sorry about the confusion.

I am trying to apply TensorOperations.contract! on a DistributedArray. Strided.UnsafeStridedView fails (see below). Do you have suggestions on how to use TensorOperations.contract! on DistributedArrays? I have written my own code of fold and unfold DistributedArray but i was hoping i do not need to do this for contract! as well. Any suggestions are welcome. Sorry again for the confusion. Thank you very much!

ERROR: MethodError: no method matching Strided.UnsafeStridedView(::DistributedArrays.DArray{Float64,3,Array{Float64,3}}) Closest candidates are: Strided.UnsafeStridedView(::DenseArray) at /Users/ftuser/.julia/packages/Strided/su1w2/src/unsafestridedview.jl:19 Strided.UnsafeStridedView(::Strided.StridedView) at /Users/ftuser/.julia/packages/Strided/su1w2/src/unsafestridedview.jl:20 Strided.UnsafeStridedView(::LinearAlgebra.Adjoint{#s20,#s19} where #s19<:(Union{DenseArray{T,N}, ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, ReshapedArray{T,N,A,MI} where MI<:Tuple{Vararg{SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, SubArray{T,N,A,I,L} where L where I<:Tuple{Vararg{Union{Int64, AbstractRange{Int64}, AbstractCartesianIndex},N} where N} where A<:Union{ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, ReshapedArray{T,N,A,MI} where MI<:Tuple{Vararg{SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, DenseArray}} where N where T) where #s20) at /Users/ftuser/.julia/packages/Strided/su1w2/src/unsafestridedview.jl:22 ...