Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
IrrationalConstants = "92d709cd-6900-40b7-9082-c6be49f344b6"
LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RealDot = "c1ae055f-0cd5-4b69-90a6-9a35b1a98df9"
Expand All @@ -27,6 +28,7 @@ Distributed = "1"
FiniteDifferences = "0.12.20"
GPUArraysCore = "0.1.0"
IrrationalConstants = "0.1.1, 0.2"
LazyArrays = "1, 2"
JLArrays = "0.1"
JuliaInterpreter = "0.8,0.9"
LinearAlgebra = "1"
Expand Down
1 change: 1 addition & 0 deletions src/ChainRules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ using RealDot: realdot
using SparseArrays
using Statistics
using StructArrays
using LazyArrays: @~

# Basically everything this package does is overloading these, so we make an exception
# to the normal rule of only overload via `ChainRulesCore.rrule`.
Expand Down
3 changes: 2 additions & 1 deletion src/rulesets/LinearAlgebra/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ function rrule(::typeof(dot), x::AbstractVector{<:Number}, A::AbstractMatrix{<:N
function dot_pullback(Ω̄)
ΔΩ = unthunk(Ω̄)
dx = @thunk project_x(conj(ΔΩ) .* Ay)
dA = @thunk project_A(ΔΩ .* x .* adjoint(y))
ay = adjoint(y)
dA = @thunk @~(ΔΩ .* x .* ay)
dy = @thunk project_y(ΔΩ .* (adjoint(A) * x))
return (NoTangent(), dx, dA, dy)
end
Expand Down