Closed
Description
I believe these should all be (Zero, 3)
:
julia> Zygote.gradient((x,y) -> sum(fill!(x,y)), [1,2,3], 4)
(nothing, nothing)
julia> Zygote.gradient((x,y) -> sum(map(_ -> y, x)), [1,2,3], 4)
([nothing, nothing, nothing], 3)
julia> Diffractor.gradient((x,y) -> sum(fill!(x,y)), [1,2,3], 4)
(ChainRulesCore.NoTangent(), ChainRulesCore.NoTangent())
julia> Diffractor.gradient((x,y) -> sum(map(_ -> y, x)), [1,2,3], 4)
ERROR: AssertionError: Base.issingletontype(typeof(f))
Stacktrace:
[1] (::∂⃖{1})(#unused#::typeof(map), f::Function, a::Vector{Int64})
@ Diffractor ~/.julia/packages/Diffractor/K2lJa/src/jet.jl:185
More generally, should in-place functions which completely overwrite their input be allowed? Like circshift!
or sum!
or mul!
.
Metadata
Metadata
Assignees
Labels
No labels