Skip to content

Commit

Permalink
Merge pull request #302 from aussetg/adapt_wrappers
Browse files Browse the repository at this point in the history
Adapt rules for batched_* wrappers
  • Loading branch information
CarloLucibello authored Mar 23, 2021
2 parents aa5a6bd + 3e417ed commit a9727e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ uuid = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
version = "0.7.18"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
4 changes: 4 additions & 0 deletions src/batched/batchedadjtrans.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using LinearAlgebra

import Base: -
import Adapt: adapt_structure, adapt

_batched_doc = """
batched_transpose(A::AbstractArray{T,3})
Expand Down Expand Up @@ -100,3 +101,6 @@ function rrule(::typeof(batched_adjoint), A::AbstractArray{<:Any,3})
b_adjoint_back(Δ) = (NO_FIELDS, batched_adjoint(Δ))
batched_adjoint(A), b_adjoint_back
end

adapt_structure(to, x::BatchedAdjoint) = BatchedAdjoint(adapt(to, parent(x)))
adapt_structure(to, x::BatchedTranspose) = BatchedTranspose(adapt(to, parent(x)))

2 comments on commit a9727e4

@CarloLucibello
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/32609

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.18 -m "<description of version>" a9727e4dc94b7a9a803ab5a397ab309e3a20ab76
git push origin v0.7.18

Please sign in to comment.