We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4fc02c commit 17a5673Copy full SHA for 17a5673
src/lib/broadcast.jl
@@ -80,6 +80,8 @@ unbroadcast(x::AbstractArray, x̄::Nothing) = nothing
80
81
@adjoint broadcasted(::typeof(-), x::Numeric, y::Numeric) = x .- y,
82
Δ -> (nothing, unbroadcast(x, Δ), _minus(unbroadcast(y, Δ)))
83
+@adjoint broadcasted(::typeof(-), x::Numeric) = .-x,
84
+ Δ -> (nothing, _minus(Δ))
85
_minus(Δ) = -Δ
86
_minus(::Nothing) = nothing
87
0 commit comments