@@ -44,7 +44,7 @@ Zygote.@adjoint function broadcasted(::typeof(+), a::AbstractArray{<:Number}, b:
44
44
end
45
45
Zygote. @adjoint function broadcasted (:: typeof (+ ), b:: Bool , a:: AbstractArray{<:Number} )
46
46
y = b === false ? a : b .+ a
47
- return y, Δ -> (nothing , nothing , Δ)
47
+ y, Δ -> (nothing , nothing , Δ)
48
48
end
49
49
50
50
@@ -53,23 +53,22 @@ Zygote.@adjoint function broadcasted(::typeof(-), a::AbstractArray{<:Number}, b:
53
53
y, Δ -> (nothing , Δ, nothing )
54
54
end
55
55
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 , .- Δ)
58
57
end
59
58
60
59
61
60
Zygote. @adjoint function broadcasted (:: typeof (* ), a:: AbstractArray{<:Number} , b:: Bool )
62
61
if b === false
63
- return zero (a), Δ -> (nothing , zero (Δ), nothing )
62
+ zero (a), Δ -> (nothing , zero (Δ), nothing )
64
63
else
65
- return a, Δ -> (nothing , Δ, nothing )
64
+ a, Δ -> (nothing , Δ, nothing )
66
65
end
67
66
end
68
67
Zygote. @adjoint function broadcasted (:: typeof (* ), b:: Bool , a:: AbstractArray{<:Number} )
69
68
if b === false
70
- return zero (a), Δ -> (nothing , nothing , zero (Δ))
69
+ zero (a), Δ -> (nothing , nothing , zero (Δ))
71
70
else
72
- return a, Δ -> (nothing , nothing , Δ)
71
+ a, Δ -> (nothing , nothing , Δ)
73
72
end
74
73
end
75
74
0 commit comments