Skip to content

Commit 45f907d

Browse files
author
Michael Abbott
committed
tweaks, to trash later
1 parent 10e853f commit 45f907d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/deprecations.jl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Zygote.@adjoint function broadcasted(::typeof(+), a::AbstractArray{<:Number}, b:
4444
end
4545
Zygote.@adjoint function broadcasted(::typeof(+), b::Bool, a::AbstractArray{<:Number})
4646
y = b === false ? a : b .+ a
47-
return y, Δ -> (nothing, nothing, Δ)
47+
y, Δ -> (nothing, nothing, Δ)
4848
end
4949

5050

@@ -53,23 +53,22 @@ Zygote.@adjoint function broadcasted(::typeof(-), a::AbstractArray{<:Number}, b:
5353
y, Δ -> (nothing, Δ, nothing)
5454
end
5555
Zygote.@adjoint function broadcasted(::typeof(-), b::Bool, a::AbstractArray{<:Number})
56-
y = b === false ? .-a : b .- a
57-
return y, Δ -> (nothing, nothing, .-Δ)
56+
b .- a, Δ -> (nothing, nothing, .-Δ)
5857
end
5958

6059

6160
Zygote.@adjoint function broadcasted(::typeof(*), a::AbstractArray{<:Number}, b::Bool)
6261
if b === false
63-
return zero(a), Δ -> (nothing, zero(Δ), nothing)
62+
zero(a), Δ -> (nothing, zero(Δ), nothing)
6463
else
65-
return a, Δ -> (nothing, Δ, nothing)
64+
a, Δ -> (nothing, Δ, nothing)
6665
end
6766
end
6867
Zygote.@adjoint function broadcasted(::typeof(*), b::Bool, a::AbstractArray{<:Number})
6968
if b === false
70-
return zero(a), Δ -> (nothing, nothing, zero(Δ))
69+
zero(a), Δ -> (nothing, nothing, zero(Δ))
7170
else
72-
return a, Δ -> (nothing, nothing, Δ)
71+
a, Δ -> (nothing, nothing, Δ)
7372
end
7473
end
7574

0 commit comments

Comments
 (0)