I have this code:
using Zygote
function test_gradient()
return gradient(x -> 3x^2 + 2x + 1, 5)
end
and I am trying to debug it by setting a breakpoint in vscode. I get the following error when reaching y, back = pullback(f, args…):
julia> @run test_gradient()
Error while running the debugger (consider adding a breakpoint for uncaught exceptions):
ERROR: MethodError: no method matching getindex(::Nothing, ::Int64)
Stacktrace:
[1] stack_trace_request(conn::VSCodeServer.JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, state::VSCodeServer.DebugAdapter.DebuggerState, params::VSCodeServer.DebugAdapter.StackTraceArguments)
@ VSCodeServer.DebugAdapter ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/packages/DebugAdapter/src/debugger_requests.jl:403
[2] (::VSCodeServer.DebugAdapter.var"#128#154"{VSCodeServer.DebugAdapter.DebuggerState})(conn::VSCodeServer.JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, params::VSCodeServer.DebugAdapter.StackTraceArguments)
@ VSCodeServer.DebugAdapter ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/packages/DebugAdapter/src/packagedef.jl:55
[3] dispatch_msg(x::VSCodeServer.JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, dispatcher::VSCodeServer.JSONRPC.MsgDispatcher, msg::Dict{String, Any})
@ VSCodeServer.JSONRPC ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/packages/JSONRPC/src/typed.jl:67
[4] macro expansion
@ ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/packages/DebugAdapter/src/packagedef.jl:76 [inlined]
[5] (::VSCodeServer.DebugAdapter.var"#146#172"{VSCodeServer.var"#186#188", VSCodeServer.JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, VSCodeServer.JSONRPC.MsgDispatcher})()
@ VSCodeServer.DebugAdapter ./task.jl:484