Skip to content

Commit c7b9cd3

Browse files
author
Michael Abbott
committed
rm gradient definitions, now in Zygote 0.6
1 parent b70ee4c commit c7b9cd3

File tree

2 files changed

+1
-42
lines changed

2 files changed

+1
-42
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ NNlib = "0.7"
3838
Reexport = "0.2"
3939
StatsBase = "0.33"
4040
ZipFile = "0.9"
41-
Zygote = "0.5"
41+
Zygote = "0.6"
4242
julia = "1.5"
4343

4444
[extras]

src/deprecations.jl

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -31,44 +31,3 @@ function Broadcast.broadcasted(::typeof(logitbinarycrossentropy), ŷ, y)
3131
@warn "logitbinarycrossentropy.(ŷ, y) is deprecated, use Losses.logitbinarycrossentropy(ŷ, y, agg=identity) instead"
3232
Losses.logitbinarycrossentropy(ŷ, y, agg=identity)
3333
end
34-
35-
36-
# To move to Zygote
37-
38-
using Base.Broadcast: broadcasted
39-
40-
41-
Zygote.@adjoint function broadcasted(::typeof(+), a::AbstractArray{<:Number}, b::Bool)
42-
y = b === false ? a : a .+ b
43-
y, Δ -> (nothing, Δ, nothing)
44-
end
45-
Zygote.@adjoint function broadcasted(::typeof(+), b::Bool, a::AbstractArray{<:Number})
46-
y = b === false ? a : b .+ a
47-
y, Δ -> (nothing, nothing, Δ)
48-
end
49-
50-
51-
Zygote.@adjoint function broadcasted(::typeof(-), a::AbstractArray{<:Number}, b::Bool)
52-
y = b === false ? a : a .- b
53-
y, Δ -> (nothing, Δ, nothing)
54-
end
55-
Zygote.@adjoint function broadcasted(::typeof(-), b::Bool, a::AbstractArray{<:Number})
56-
b .- a, Δ -> (nothing, nothing, .-Δ)
57-
end
58-
59-
60-
Zygote.@adjoint function broadcasted(::typeof(*), a::AbstractArray{<:Number}, b::Bool)
61-
if b === false
62-
zero(a), Δ -> (nothing, zero(Δ), nothing)
63-
else
64-
a, Δ -> (nothing, Δ, nothing)
65-
end
66-
end
67-
Zygote.@adjoint function broadcasted(::typeof(*), b::Bool, a::AbstractArray{<:Number})
68-
if b === false
69-
zero(a), Δ -> (nothing, nothing, zero(Δ))
70-
else
71-
a, Δ -> (nothing, nothing, Δ)
72-
end
73-
end
74-

0 commit comments

Comments
 (0)