-
Notifications
You must be signed in to change notification settings - Fork 2
[BUG] call(::BlockSparseArrayInterface, ::typeof(similar), ::BlockSparseArray
is ambiguous
#98
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
Comments
Thanks for the report, looking into it now. |
It seems like the issue is caused by the fact that this line: https://github.com/ogauthe/BlockSparseArrays.jl/blob/6c2204bf9b18e53bb9c9c11827681c91bce8222c/ext/BlockSparseArraysTensorAlgebraExt/BlockSparseArraysTensorAlgebraExt.jl#L21 constructs axes Maybe there could be a version of |
Fundamentally, the error is being thrown because that similar call on BlockSparseArray doesn't anticipate that a non-blocked range ( |
There are similar issues with graded arrays, I will work on |
minimal example that triggers error on using BlockSparseArrays: BlockSparseArray
a = BlockSparseArray{Float64}(undef)
similar(a, Float64, (Base.OneTo(1),)) ERROR: MethodError: call(::BlockSparseArrays.BlockSparseArrayInterface, ::typeof(similar), ::BlockSparseArray{…}, ::Type{…}, ::Tuple{…}) is ambiguous.
Candidates:
call(::BlockSparseArrays.AbstractBlockSparseArrayInterface, ::typeof(similar), a::AbstractArray, elt::Type, axes::Tuple)
@ BlockSparseArrays ~/.julia/packages/BlockSparseArrays/1g9zF/src/abstractblocksparsearray/wrappedabstractblocksparsearray.jl:230
call(interface::DerivableInterfaces.AbstractArrayInterface, ::typeof(similar), a::AbstractArray, T::Type, axes::Tuple{Base.OneTo, Vararg{Base.OneTo}})
@ DerivableInterfaces ~/.julia/packages/DerivableInterfaces/ZNBYA/src/abstractarrayinterface.jl:99
Possible fix, define
call(::BlockSparseArrays.AbstractBlockSparseArrayInterface, ::typeof(similar), ::AbstractArray, ::Type, ::Tuple{…})
Stacktrace:
[1] (::DerivableInterfaces.InterfaceFunction{…})(::BlockSparseArray{…}, ::Vararg{…}; kwargs::@Kwargs{})
@ DerivableInterfaces ~/.julia/packages/DerivableInterfaces/ZNBYA/src/interface_function.jl:17
[2] similar(a::BlockSparseArray{…}, elt::Type, axes::Tuple{…})
@ BlockSparseArrays ~/.julia/packages/BlockSparseArrays/1g9zF/src/abstractblocksparsearray/wrappedabstractblocksparsearray.jl:323
[3] top-level scope
@ REPL[3]:1
Some type information was truncated. Use `show(err)` to see complete types. |
That should be fixed by #99. |
This issue is triggered by vector-vector contraction in #95
a_dest, dimnames_dest = contract(a3, (1, 2), a3, (2, 1)) # from test_tensoralgebraext
The text was updated successfully, but these errors were encountered: