Skip to content

Commit

Permalink
Merge pull request #45 from FluxML/ap/patch
Browse files Browse the repository at this point in the history
Missing Identity Activation Import
  • Loading branch information
ToucheSir authored Sep 5, 2022
2 parents 617a43f + d5a9183 commit ccf4685
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/CUDAExt/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "NNlibCUDA"
uuid = "a00861dc-f156-4864-bf3c-e6376f28a68d"
version = "0.2.4"
version = "0.2.5"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
3 changes: 2 additions & 1 deletion ext/CUDAExt/src/cudnn/activations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
using Base.Broadcast
using CUDA.CUDNN: cudnnActivationForward!, cudnnOpTensor!,
CUDNN_ACTIVATION_TANH,CUDNN_ACTIVATION_SIGMOID,CUDNN_ACTIVATION_ELU,
CUDNN_ACTIVATION_RELU,CUDNN_ACTIVATION_CLIPPED_RELU,CUDNN_OP_TENSOR_MAX
CUDNN_ACTIVATION_RELU,CUDNN_ACTIVATION_CLIPPED_RELU,CUDNN_OP_TENSOR_MAX,
CUDNN_ACTIVATION_IDENTITY

for (f, op) in [
CUDA.tanh => (src,dst)->cudnnActivationForward!(dst, src, mode=CUDNN_ACTIVATION_TANH),
Expand Down
6 changes: 6 additions & 0 deletions ext/CUDAExt/test/conv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ using NNlib: DenseConvDims
@test ∇conv_data(c, b, cdims) collect(∇conv_data(dc, db, cdims))
@test ∇conv_filter(a, c, cdims) collect(∇conv_filter(da, dc, cdims))

# Test Conv Bias Activation
bias = rand(Float64, 1, 1, 4, 1)
dbias = CuArray(bias)
@test conv_bias_act(a, b, cdims, bias, NNlib.relu) collect(conv_bias_act(da, db, cdims, dbias, NNlib.relu))
@test conv_bias_act(a, b, cdims, bias, identity) collect(conv_bias_act(da, db, cdims, dbias, identity))

# Test for agreement between CPU NNlib and CuDNN versions, across a variety of kwargs
options = Dict{Any, Any}.((
(), (:dilation => 2), (:flipkernel => true), (:stride => 2),
Expand Down

0 comments on commit ccf4685

Please sign in to comment.