Skip to content

Commit 0bae677

Browse files
committed
tests
1 parent a730c70 commit 0bae677

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/compiler/chainrules.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ The two-argument `_project(x, dx)` applies this immediately.
155155
#
156156
# But the original case was an array of Union{Int,Nothing}
157157

158+
# Solve some ambiguity:
159+
(::ProjectTo{ChainRulesCore.NoTangent})(::ChainRulesCore.AbstractZero) = NoTangent()
160+
158161
"""
159162
ZBack{F}(back) <: Function
160163

test/gradcheck.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,7 @@ end
16781678
# check that type is not unnecessarily promoted
16791679
# https://github.com/FluxML/Zygote.jl/issues/663
16801680
@test gradient(norm, randn(Float32, 2, 2)) isa Tuple{Matrix{Float32}}
1681-
@test gradient(norm, randn(Float32, 2, 2), 3) isa Tuple{Matrix{Float32},Float32}
1681+
@test gradient(norm, randn(Float32, 2, 2), 3) isa Tuple{Matrix{Float32},Float64}
16821682
@test gradient(norm, randn(Float32, 2, 2), 3f0) isa Tuple{Matrix{Float32},Float32}
16831683
@test gradient(norm, randn(ComplexF32, 2, 2), 3.5f0) isa Tuple{Matrix{ComplexF32},Float32}
16841684

0 commit comments

Comments
 (0)