Skip to content

Commit

Permalink
remove _subtract!!
Browse files Browse the repository at this point in the history
  • Loading branch information
oxinabox committed Oct 15, 2020
1 parent 03688d2 commit d9461cd
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 32 deletions.
2 changes: 1 addition & 1 deletion src/rulesets/Base/arraymath.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ end

function rrule(::typeof(-), x::AbstractArray)
function negation_pullback(ȳ)
return NO_FIELDS, InplaceableThunk(@thunk(-ȳ), ā -> _subtract!!(ā, ȳ))
return NO_FIELDS, InplaceableThunk(@thunk(-ȳ), ā -> .-=)
end
return -x, negation_pullback
end
3 changes: 0 additions & 3 deletions src/rulesets/LinearAlgebra/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ _mulsubtrans!!(X::AbstractZero, F::AbstractZero) = X
_mulsubtrans!!(X::AbstractZero, F::AbstractMatrix{<:Real}) = X
_mulsubtrans!!(X::AbstractMatrix{<:Real}, F::AbstractZero) = F

_subtract!!(x, y) = x - y
_subtract!!(x::Array, y::AbstractArray) = x .-= y

# I - X, overwrites X
function _eyesubx!(X::AbstractMatrix)
n, m = size(X)
Expand Down
27 changes: 0 additions & 27 deletions test/rulesets/LinearAlgebra/utils.jl

This file was deleted.

1 change: 0 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ println("Testing ChainRules.jl")
include(joinpath("rulesets", "LinearAlgebra", "structured.jl"))
include(joinpath("rulesets", "LinearAlgebra", "factorization.jl"))
include(joinpath("rulesets", "LinearAlgebra", "blas.jl"))
include(joinpath("rulesets", "LinearAlgebra", "utils.jl"))
end

print(" ")
Expand Down

0 comments on commit d9461cd

Please sign in to comment.