Skip to content

Commit

Permalink
Merge pull request #7 from andreasnoack/master
Browse files Browse the repository at this point in the history
Fix adapt of Adjoint
  • Loading branch information
maleadt authored Aug 14, 2018
2 parents 04cd8d3 + a7667a7 commit 6a47181
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ adapt(CuArray, ::Adjoint{Array})::Adjoint{CuArray}
New data types like `Adjoint` should overload `adapt(T, ::Adjoint)` (usually just to forward the call to `adapt`).

```julia
adapt(T, x::Adjoint) = Adjoint(adapt(T, x.vec))
adapt(T, x::Adjoint) = Adjoint(adapt(T, parent(x)))
```

New adaptor types like `CuArray` should overload `adapt_` for compatible types.
Expand Down
2 changes: 1 addition & 1 deletion src/Adapt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ adapt(T, x) = adapt_(T, x)

# Base integrations

adapt(T, x::Adjoint) = Adjoint(adapt(T, vec(x)))
adapt(T, x::Adjoint) = Adjoint(adapt(T, parent(x)))

end # module

0 comments on commit 6a47181

Please sign in to comment.