Skip to content

Commit 7eb435b

Browse files
committed
more overloads for StaticArrays
1 parent b642a9f commit 7eb435b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/extra_rules.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ function ChainRules.frule((_, ∂x), ::Type{SArray{S, T, N, L}}, x::NTuple{L,T})
178178
end
179179

180180
Base.view(t::Tangent{T}, inds) where T<:SVector = view(T(ChainRulesCore.backing(t.data)), inds)
181+
Base.getindex(t::Tangent{<:SVector, <:NamedTuple}, ind::Int) = ChainRulesCore.backing(t.data)[ind]
181182

182183
function ChainRules.frule((_, ∂x), ::Type{SArray{S, T, N, L}}, x::NTuple{L,Any}) where {S, T, N, L}
183184
SArray{S, T, N, L}(x), SArray{S}(∂x)

0 commit comments

Comments
 (0)