Skip to content

Commit

Permalink
ReverseDiff fixes (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed82008 authored Mar 22, 2020
1 parent 24e8ff2 commit d0c4857
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
ArgCheck = "1, 2.0"
Combinatorics = "0.7"
Compat = "3.0"
Distributions = "0.21.11, 0.22"
Distributions = "0.21.11, 0.22, 0.23"
DistributionsAD = "0.4.6"
ForwardDiff = "0.10.3"
MappedArrays = "0.2.2"
Expand Down
12 changes: 1 addition & 11 deletions src/compat/reversediff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ using ReverseDiff: SpecialInstruction

_eps(::Type{<:RTR{T}}) where {T} = _eps(T)

Base.:*(A::RTM{<:Any, D}, B::AbstractTriangular) where {D} = record_mul(A, B, D)
Base.:*(A::AbstractTriangular, B::RTV{<:Any, D}) where {D} = record_mul(A, B, D)
Base.:*(A::AbstractTriangular, B::RTM{<:Any, D}) where {D} = record_mul(A, B, D)
function Base.:*(A::Adjoint{T, <:AbstractTriangular{T}}, B::RTM{<:Any, D}) where {T, D}
return record_mul(A, B, D)
end
function Base.:*(A::Adjoint{T, <:AbstractTriangular{T}}, B::RTV{<:Any, D}) where {T, D}
return record_mul(A, B, D)
end

function replace_diag(::typeof(log), X::RTM{<:Any, D}) where {D}
tp = ReverseDiff.tape(X)
X_value = ReverseDiff.value(X)
Expand Down Expand Up @@ -54,7 +44,7 @@ end
return nothing
end

@noinline function special_forward_exec!(instruction::SpecialInstruction{typeof(replace_diag)})
@noinline function ReverseDiff.special_forward_exec!(instruction::SpecialInstruction{typeof(replace_diag)})
output, input = instruction.output, instruction.input
out_value = replace_diag(ReverseDiff.value(input[1]), ReverseDiff.value(input[2]))
ReverseDiff.value!(output, out_value)
Expand Down

0 comments on commit d0c4857

Please sign in to comment.