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

Extend kron support #1458

Merged
merged 2 commits into from
Sep 27, 2023
Merged

Extend kron support #1458

merged 2 commits into from
Sep 27, 2023

Conversation

willtebbutt
Copy link
Member

@willtebbutt willtebbutt commented Sep 26, 2023

The current kron rules do not handle kron(::AbstractMatrix, ::AbstractVector) or kron(::AbstractVector, ::AbstractMatrix). This PR adds support for both. Fortunately, the implementation strategy is precisely the same as the one currently taken.

A method of _pullback for kron is removed in favour of a single method of _pullback which can handle all four combinations of argument types.

Fixes JuliaGaussianProcesses/TemporalGPs.jl#115

PR Checklist

  • Tests are added
  • Documentation, if applicable

Copy link
Member

@ToucheSir ToucheSir left a comment

Choose a reason for hiding this comment

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

I can't wait for us to be rid of this rule

@willtebbutt willtebbutt merged commit cf7f7d0 into master Sep 27, 2023
11 of 12 checks passed
@willtebbutt willtebbutt deleted the wct/extend-kron-support branch September 27, 2023 07:14
@willtebbutt
Copy link
Member Author

Has it caused you problems previously?

@simsurace
Copy link
Contributor

I can't wait for us to be rid of this rule

Maybe in the not-so-distant future:
JuliaDiff/ChainRules.jl#741

@ToucheSir
Copy link
Member

Has it caused you problems previously?

Not so much. It was just frustrating to have CI broken for so long (in Zygote and Tracker) because of changes in Base and to have to patch the issue in the AD itself instead of in ChainRules. I'm glad to see progress is being made on a proper rule :)

Pangoraw pushed a commit to Pangoraw/Zygote.jl that referenced this pull request Dec 4, 2023
* Bump patch

* Generalise kron implementation
Pangoraw pushed a commit to Pangoraw/Zygote.jl that referenced this pull request Dec 4, 2023
* Bump patch

* Generalise kron implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants