Skip to content

Commit

Permalink
Don't conjugate real numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
oxinabox committed Sep 17, 2020
1 parent fdd28c1 commit 74d5ca1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rulesets/LinearAlgebra/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ end

function rrule(::typeof(*), A::Real, B::AbstractArray{<:Real})
function times_pullback(Ȳ)
return (NO_FIELDS, @thunk(dot(Ȳ, B)), @thunk(A' * Ȳ))
return (NO_FIELDS, @thunk(dot(Ȳ, B)), @thunk(A * Ȳ))
end
return A * B, times_pullback
end

function rrule(::typeof(*), B::AbstractArray{<:Real}, A::Real)
function times_pullback(Ȳ)
return (NO_FIELDS, @thunk(A' * Ȳ), @thunk(dot(Ȳ, B)))
return (NO_FIELDS, @thunk(A * Ȳ), @thunk(dot(Ȳ, B)))
end
return A * B, times_pullback
end
Expand Down

0 comments on commit 74d5ca1

Please sign in to comment.