Skip to content

Commit 39c2d17

Browse files
authored
Fix ambiguity in _setindex_zero (#669)
* fix ambiguity in _setindex_zero * bump
1 parent 595abfd commit 39c2d17

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ChainRules"
22
uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2"
3-
version = "1.44.3"
3+
version = "1.44.4"
44

55
[deps]
66
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/rulesets/Base/indexing.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ and its element type is wide enough to allow `setindex!(dx, dy, inds...)`, which
101101
It's unfortunate to close over `x`, but `similar(typeof(x), axes(x))` doesn't
102102
allow `eltype(dy)`, nor does it work for many structured matrices.
103103
"""
104-
_setindex_zero(x::AbstractArray{<:Number}, dy, inds::Integer...) = fill!(similar(x, typeof(dy), axes(x)), ZeroTangent())
105-
_setindex_zero(x::AbstractArray{<:Number}, dy, inds...) = fill!(similar(x, eltype(dy), axes(x)), ZeroTangent())
104+
_setindex_zero(x::AbstractArray{<:Number}, dy, inds::Integer...) = fill!(similar(x, typeof(dy), axes(x)), false)
105+
_setindex_zero(x::AbstractArray{<:Number}, dy, inds...) = fill!(similar(x, eltype(dy), axes(x)), false)
106106
function _setindex_zero(x::AbstractArray, dy, inds::Integer...)
107107
# This allows for types which don't define zero (like Vector) and types whose zero special (like Tangent),
108108
# but always makes an abstract type. TODO: make it infer concrete type for e.g. vectors of SVectors

0 commit comments

Comments
 (0)