Skip to content

Commit

Permalink
Fix adapt of Adjoint
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed Aug 13, 2018
1 parent 04cd8d3 commit a7667a7
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 a7667a7

Please sign in to comment.