You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like finite difference implementation has hard time going through iterate (see MRE and full stacktrace below):
juia>test_rrule(Base.iterate, (3.0, 5.0); check_inferred=false)
test_rrule: iterate on Float64,Float64: Error During Test at /home/azbs/.julia/packages/ChainRulesTestUtils/YbVdW/src/testers.jl:193
Got exception outside of a @test
DimensionMismatch: second dimension of A, 2, does not match length of x, 1
Stacktrace:
[1] gemv!(y::Vector{Float64}, tA::Char, A::Matrix{Float64}, x::Vector{Float64}, α::Bool, β::Bool)
@ LinearAlgebra /opt/julia-1.8.0/share/julia/stdlib/v1.8/LinearAlgebra/src/matmul.jl:493...
[7] _make_j′vp_call(fdm::Any, f::Any, ȳ::Any, xs::Any, ignores::Any)
@ ChainRulesTestUtils ~/.julia/packages/ChainRulesTestUtils/YbVdW/src/finite_difference_calls.jl:51...
Below I provide rrule() implementation for iterate on tuples for convenience, but perhaps the example can be narrowed down to direct invocation of _make_j′vp_call(). Also, I see the same error when testing with arrays.
MWE
using ChainRulesCore
import ChainRulesCore.rrule
using ChainRulesTestUtils
functionungetfield(dy, s::Tuple, f::Int)
T =typeof(s)
returnTangent{T}([i == f ? dy :ZeroTangent() for i=1:length(s)]...)
endfunctionrrule(::typeof(iterate), t::Tuple)
y =iterate(t)
functioniterate_pullback(dy)
dy =unthunk(dy)
returnNoTangent(), ungetfield(dy[1], t, 1)
endreturn y, iterate_pullback
endfunctionrrule(::typeof(iterate), t::Tuple, i::Integer)
y =iterate(t, i)
functioniterate_pullback(dy)
dy =unthunk(dy)
returnNoTangent(), ungetfield(dy[1], t, i), ZeroTangent()
endreturn y, iterate_pullback
endtest_rrule(Base.iterate, (3.0, 5.0); check_inferred=false)
It looks like finite difference implementation has hard time going through
iterate
(see MRE and full stacktrace below):Below I provide
rrule()
implementation foriterate
on tuples for convenience, but perhaps the example can be narrowed down to direct invocation of_make_j′vp_call()
. Also, I see the same error when testing with arrays.MWE
Complete stacktrace
The text was updated successfully, but these errors were encountered: