Skip to content

Commit

Permalink
Merge pull request #216 from FluxML/cl/nn
Browse files Browse the repository at this point in the history
nnpack no more default for conv
  • Loading branch information
CarloLucibello authored Jul 2, 2020
2 parents 2729369 + b2abb7c commit be66282
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "NNlib"
uuid = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
version = "0.7.0"
version = "0.7.1"

[deps]
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Expand Down
39 changes: 20 additions & 19 deletions src/conv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -211,23 +211,24 @@ for front_name in (:conv, :∇conv_data, :∇conv_filter,
end

# Use NNPACK if it is available and the operation is supported
if is_nnpack_available()
function conv(x::Array{Float32, 4}, w::Array{Float32, 4},
cdims::DenseConvDims{2, K, C_in, C_out, (1, 1), P, (1, 1), F};
kwargs...) where {K, C_in, C_out, P, F}
return conv_nnpack(x, w, cdims; kwargs...)
end

function ∇conv_data(dy::Array{Float32, 4}, w::Array{Float32, 4},
cdims::DenseConvDims{2, K, C_in, C_out, (1, 1), P, (1, 1), F};
kwargs...) where {K, C_in, C_out, P, F}
return ∇conv_data_nnpack(dy, w, cdims; kwargs...)
end

function ∇conv_filter(x::Array{Float32, 4}, dy::Array{Float32, 4},
cdims::DenseConvDims{2, K, C_in, C_out, (1, 1), P, (1, 1), F};
kwargs...) where {K, C_in, C_out, P, F}
return ∇conv_filter_nnpack(x, dy, cdims; kwargs...)
end
end
# commented out 'till proper benchmarking and more correctness test are performed
# if is_nnpack_available()
# function conv(x::Array{Float32, 4}, w::Array{Float32, 4},
# cdims::DenseConvDims{2, K, C_in, C_out, (1, 1), P, (1, 1), F};
# kwargs...) where {K, C_in, C_out, P, F}
# return conv_nnpack(x, w, cdims; kwargs...)
# end

# function ∇conv_data(dy::Array{Float32, 4}, w::Array{Float32, 4},
# cdims::DenseConvDims{2, K, C_in, C_out, (1, 1), P, (1, 1), F};
# kwargs...) where {K, C_in, C_out, P, F}
# return ∇conv_data_nnpack(dy, w, cdims; kwargs...)
# end

# function ∇conv_filter(x::Array{Float32, 4}, dy::Array{Float32, 4},
# cdims::DenseConvDims{2, K, C_in, C_out, (1, 1), P, (1, 1), F};
# kwargs...) where {K, C_in, C_out, P, F}
# return ∇conv_filter_nnpack(x, dy, cdims; kwargs...)
# end
# end
########################################################

2 comments on commit be66282

@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/17314

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.1 -m "<description of version>" be6628295594abbe563df17f4a18b617049832ee
git push origin v0.7.1

Please sign in to comment.