@@ -31,44 +31,3 @@ function Broadcast.broadcasted(::typeof(logitbinarycrossentropy), ŷ, y)
31
31
@warn " logitbinarycrossentropy.(ŷ, y) is deprecated, use Losses.logitbinarycrossentropy(ŷ, y, agg=identity) instead"
32
32
Losses. logitbinarycrossentropy (ŷ, y, agg= identity)
33
33
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