File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
name = " ChainRulesCore"
2
2
uuid = " d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
3
- version = " 1.15.0 "
3
+ version = " 1.15.1 "
4
4
5
5
[deps ]
6
6
Compat = " 34da2185-b29b-5c13-b0c7-acf172513d20"
Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ _eltype_projectto(::Type{<:Irrational}) = ProjectTo{Real}()
207
207
208
208
# In other cases, store a projector per element:
209
209
function ProjectTo (xs:: AbstractArray )
210
- elements = map ( ProjectTo, xs)
210
+ elements = ProjectTo .( xs)
211
211
if elements isa AbstractArray{<: ProjectTo{<:AbstractZero} }
212
212
return ProjectTo {NoTangent} () # short-circuit if all elements project to zero
213
213
else
Original file line number Diff line number Diff line change @@ -107,6 +107,10 @@ struct NoSuperType end
107
107
@test Tuple (ProjectTo (Any[1 , 2 + 3im ])(1 : 2 )) === (1.0 , 2.0 + 0.0im )
108
108
@test ProjectTo (Any[true , false ]) isa ProjectTo{NoTangent}
109
109
110
+ # projecting other things should still infer
111
+ @inferred ProjectTo ([one, one])
112
+ @inferred ProjectTo ([" x" , " y" ])
113
+
110
114
# empty arrays
111
115
@test isempty (ProjectTo ([])(1 : 0 ))
112
116
@test_throws DimensionMismatch ProjectTo (Int[])([2 ])
You can’t perform that action at this time.
0 commit comments