Skip to content

Commit aa1a34d

Browse files
authored
Remove abd oerliad of calling array on an array
1 parent 8849817 commit aa1a34d

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/rulesets/Base/arraymath.jl

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -381,33 +381,6 @@ function rrule(::typeof(\), A::AbstractVecOrMat{<:Real}, B::AbstractVecOrMat{<:R
381381
return Y, backslash_pullback
382382
end
383383

384-
@static if VERSION >= v"1.9"
385-
# Need to ensure things are not scalar since since https://github.com/JuliaLang/julia/pull/44358
386-
_maybe_descalar(x) = x isa AbstractArray ? x : [x]
387-
else
388-
_maybe_descalar(x) = x
389-
end
390-
391-
function rrule(A::AbstractVecOrMat{<:Real}, B::AbstractVecOrMat{<:Real})
392-
Y = A \ B
393-
394-
395-
function backslash_pullback(ȳ)
396-
= unthunk(ȳ)
397-
398-
∂A = @thunk begin
399-
= A' \ _maybe_descalar(Ȳ)
400-
= -* Y'
401-
+= _maybe_descalar((B - A * Y) *') / A'
402-
+= (A' \ _maybe_descalar(Y)) * (Ȳ' -'A)
403-
(Ā)
404-
end
405-
∂B = @thunk (A' \ _maybe_descalar(Ȳ))
406-
return ∂A, ∂B
407-
end
408-
return Y, backslash_pullback
409-
end
410-
411384
#####
412385
##### `\`, `/` matrix-scalar_rule
413386
#####

0 commit comments

Comments
 (0)