-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
fix flux extension
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module CUDAJUDIExt | ||
|
||
import JUDI: LazyPropagation, judiVector, eval_prop | ||
isdefined(Base, :get_extension) ? (using CUDA) : (using ..CUDA) | ||
|
||
CUDA.cu(F::LazyPropagation) = CUDA.cu(eval_prop(F)) | ||
CUDA.cu(x::Vector{Matrix{T}}) where T = [CUDA.cu(x[i]) for i=1:length(x)] | ||
CUDA.cu(x::judiVector{T, Matrix{T}}) where T = judiVector{T, CUDA.CuMatrix{T}}(x.nsrc, x.geometry, CUDA.cu(x.data)) | ||
|
||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
module FluxJUDIExt | ||
|
||
import JUDI: LazyPropagation, judiVector, eval_prop | ||
import JUDI: LazyPropagation | ||
isdefined(Base, :get_extension) ? (using Flux) : (using ..Flux) | ||
|
||
Flux.cpu(x::LazyPropagation) = Flux.cpu(eval_prop(x)) | ||
Flux.gpu(x::LazyPropagation) = Flux.gpu(eval_prop(x)) | ||
Flux.CUDA.cu(F::LazyPropagation) = Flux.CUDA.cu(eval_prop(F)) | ||
Flux.CUDA.cu(x::Vector{Matrix{T}}) where T = [Flux.CUDA.cu(x[i]) for i=1:length(x)] | ||
Flux.CUDA.cu(x::judiVector{T, Matrix{T}}) where T = judiVector{T, Flux.CUDA.CuMatrix{T}}(x.nsrc, x.geometry, Flux.CUDA.cu(x.data)) | ||
|
||
end |
1 comment
on commit 9d95da7
There was a problem hiding this comment.
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/112383
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
@JuliaRegistrator register
Release notes:
## Breaking changes
- blah
To add them here just re-invoke and the PR will be updated.
Tagging
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 v3.4.6 -m "<description of version>" 9d95da7b2194f1c31618135e456acd587df0720e
git push origin v3.4.6
@JuliaRegistrator register