Zygote.jl
Zygote.jl copied to clipboard
`one'(x)` errors, although `gradient(one, 0.0) === nothing` does not
using Zygote
julia> one'(0.0)
ERROR: MethodError: no method matching getindex(::Nothing, ::Int64)
Stacktrace:
[1] (::Zygote.var"#59#60"{typeof(one)})(x::Float64)
@ Zygote ~/.julia/packages/Zygote/FPUm3/src/compiler/interface.jl:83
[2] top-level scope
@ REPL[5]:1
This is only about the weird adjoint
overload, gradient
is fine:
julia> gradient(one, 0.0)
julia> one'(0.0)
ERROR: MethodError: no method matching getindex(::Nothing, ::Int64)