Skip to content

Commit

Permalink
Don't use UnionAlls in Varargs
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed Aug 8, 2022
1 parent 1f4a8a9 commit 1c5905a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/rulesets/Base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ _i_zero(ẋ::AbstractZero, x) = zero(x)
# may give a MethodError for `zero` but won't be wrong.

# Fast paths. Should it also collapse all-Zero cases?
_instantiate_zeros(ẋs::Tuple{Vararg{<:Number}}, xs) = ẋs
_instantiate_zeros(ẋs::Tuple{Vararg{<:AbstractArray}}, xs) = ẋs
_instantiate_zeros(ẋs::Tuple{Vararg{Number}}, xs) = ẋs
_instantiate_zeros(ẋs::Tuple{Vararg{AbstractArray}}, xs) = ẋs
_instantiate_zeros(ẋs::AbstractArray{<:Number}, xs) = ẋs
_instantiate_zeros(ẋs::AbstractArray{<:AbstractArray}, xs) = ẋs

Expand Down
2 changes: 1 addition & 1 deletion src/rulesets/Base/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function frule((_, ẋ), ::typeof(getindex), x::Tuple, i)
end

"for a given typle type, returns a Val{N} where N is the length of the tuple"
_tuple_N(::Type{<:Tuple{Vararg{<:Any, N}}}) where {N} = Val(N)
_tuple_N(::Type{<:Tuple{Vararg{Any, N}}}) where {N} = Val(N)

function rrule(::typeof(getindex), x::T, i::Integer) where {T<:Tuple}
function getindex_back_1(dy)
Expand Down

0 comments on commit 1c5905a

Please sign in to comment.