Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete Matric Vector multiply rules that are now in ChainRules #828

Merged
merged 3 commits into from
Dec 4, 2020
Merged
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
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Zygote"
uuid = "e88e6eb3-aa80-5325-afca-941959d7151f"
version = "0.5.14"
version = "0.5.15"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really we should avoid this, open PRs will continuously have conflicts with master, really annoying

Copy link
Member Author

@oxinabox oxinabox Dec 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷 Its just not that big a deal.
it takes 30 seconds to rebase.

The person it annoys is the PR author, and that is me.
And I am not annoyed.
If other people don't want to rebase to deal with it then they don't have to bump the version number in the PR.
I am not here telling anyone else to.

On a small PR like this one the expectation is that it would be merged quickly (and this would have been except I was on leave and this PR was made before registry had the new version and so CI needed to be retriggered.).
and in a big PR the time to rebase because the version number has changed is nothing compared to the time taken to create the PR.

Further more, rebasing pulls in the changes from master.
And it is possible to end-up with a senario that has two PRs can both pass tests on their own, but not pass tests if merged one after the other.
Rebasing prevents that.
Some CI (definately Bors, idk about our github actions) also prevent that by testing on the result of the merge, rather than testing the actual code in the branch. Still for local tests it is nice the have rebased.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, just making sure we don't force this habit on contributors


[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand All @@ -26,7 +26,7 @@ ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444"
[compat]
AbstractFFTs = "0.5"
ArrayLayouts = "0.1, 0.2, 0.3, 0.4"
ChainRules = "0.7.16"
ChainRules = "0.7.33"
DiffRules = "1.0"
FillArrays = "0.8, 0.9, 0.10"
ForwardDiff = "0.10"
Expand Down
19 changes: 2 additions & 17 deletions src/lib/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -314,23 +314,8 @@ end
end
end

# LinAlg
# ======

# TODO: remove these once https://github.com/JuliaDiff/ChainRules.jl/pull/305 is merged
@adjoint function(A::AbstractMatrix * x::AbstractVector)
return A * x, Δ::AbstractVector->(Δ * x', A' * Δ)
end

@adjoint function *(x::Union{Transpose{<:Any, <:AbstractVector},
LinearAlgebra.Adjoint{<:Any, <:AbstractVector}},
y::AbstractVector)
return x * y, Δ->(Δ * y', x' * Δ)
end

@adjoint function(a::AbstractVector * x::AbstractMatrix)
return a * x, Δ::AbstractMatrix->(vec(Δ * x'), a' * Δ)
end
# LinearAlgebra
# =============

@adjoint function transpose(x)
back(Δ) = (transpose(Δ),)
Expand Down