Skip to content

Commit 9cd9013

Browse files
committed
move exports to main source file
1 parent aa86827 commit 9cd9013

File tree

14 files changed

+40
-55
lines changed

14 files changed

+40
-55
lines changed

src/NNlib.jl

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,61 @@ const Numeric = Union{AbstractArray{<:T}, T} where {T<:Number}
1212

1313
# Include APIs
1414
include("dim_helpers.jl")
15+
export ConvDims, DenseConvDims, PoolDims, DepthwiseConvDims
1516

1617
is_nnpack_available() = false
1718

1819
@init @require NNPACK_jll="a6bfbf70-4841-5cb9-aa18-3a8ad3c413ee" begin
19-
if isdefined(NNPACK_jll, :libnnpack)
20-
include("nnpack/NNPACK.jl")
21-
else
22-
@warn "NNPACK not available for your platform: " *
23-
"$( Pkg.BinaryPlatforms.platform_name(Pkg.BinaryPlatforms.platform_key_abi()))" *
24-
"($( Pkg.BinaryPlatforms.triplet(Pkg.BinaryPlatforms.platform_key_abi())))
25-
You will be able to use only the default Julia NNlib backend"
26-
end
20+
if isdefined(NNPACK_jll, :libnnpack)
21+
include("nnpack/NNPACK.jl")
22+
else
23+
@warn "NNPACK not available for your platform: " *
24+
"$( Pkg.BinaryPlatforms.platform_name(Pkg.BinaryPlatforms.platform_key_abi()))" *
25+
"($( Pkg.BinaryPlatforms.triplet(Pkg.BinaryPlatforms.platform_key_abi())))
26+
You will be able to use only the default Julia NNlib backend"
27+
end
2728
end
2829

2930
include("activations.jl")
31+
for f in ACTIVATIONS
32+
@eval export $(f)
33+
end
34+
export sigmoid, hardsigmoid, logsigmoid, thresholdrelu # Aliases
35+
3036
include("softmax.jl")
37+
export softmax, softmax!, ∇softmax, ∇softmax!, logsoftmax,
38+
logsoftmax!, ∇logsoftmax, ∇logsoftmax!, logsumexp
39+
3140
include("batched/batchedmul.jl")
41+
export batched_mul, batched_mul!, , batched_vec,
42+
batched_transpose, batched_adjoint
43+
3244
include("gemm.jl")
45+
export grid_sample, ∇grid_sample
46+
3347
include("conv.jl")
48+
export conv, conv!, ∇conv_data, ∇conv_data!, ∇conv_filter,
49+
∇conv_filter!, depthwiseconv, depthwiseconv!,
50+
∇depthwiseconv_data, ∇depthwiseconv_data!,
51+
∇depthwiseconv_filter, ∇depthwiseconv_filter!
52+
3453
include("conv_bias_act.jl")
54+
export conv_bias_act, conv_bias_act!
55+
3556
include("pooling.jl")
57+
export maxpool, maxpool!, meanpool, meanpool!,
58+
∇maxpool, ∇maxpool!, ∇meanpool, ∇meanpool!
59+
3660
include("padding.jl")
61+
export pad_constant, pad_repeat, pad_reflect, pad_zeros
62+
3763
include("upsample.jl")
64+
export upsample_nearest, ∇upsample_nearest,
65+
upsample_linear, ∇upsample_linear,
66+
upsample_bilinear, ∇upsample_bilinear,
67+
upsample_trilinear, ∇upsample_trilinear,
68+
pixel_shuffle
69+
3870
include("gather.jl")
3971
include("scatter.jl")
4072
include("utils.jl")

src/activations.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ ACTIVATIONS = [
1111
:tanh_fast, :sigmoid_fast,
1212
]
1313

14-
for f in ACTIVATIONS
15-
@eval export $(f)
16-
end
17-
18-
# Aliases
19-
export sigmoid, hardsigmoid, logsigmoid, thresholdrelu
20-
2114
# of type float (to allow for integer inputs)
2215
oftf(x, y) = oftype(float(x), y)
2316

src/batched/batchedmul.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
2-
export batched_mul, batched_mul!, , batched_vec
3-
export batched_transpose, batched_adjoint
4-
51
include("./batchedadjtrans.jl")
62

73
using LinearAlgebra: BlasFloat, Transpose, Adjoint, AdjOrTransAbsMat

src/conv.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
export conv, conv!, ∇conv_data, ∇conv_data!, ∇conv_filter, ∇conv_filter!, depthwiseconv,
2-
depthwiseconv!, ∇depthwiseconv_data, ∇depthwiseconv_data!, ∇depthwiseconv_filter,
3-
∇depthwiseconv_filter!
4-
51
## Convolution API
62
#
73
# We provide the following generic methods, for 3d, 4d, and 5d tensors, calculating 1d,

src/conv_bias_act.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export conv_bias_act, conv_bias_act!
2-
31
function conv_bias_act(x::AbstractArray{xT,N}, w::AbstractArray{wT,N},
42
cdims::ConvDims, b::AbstractArray{bT,N}, σ=identity; kwargs...) where {xT, wT, bT, N}
53
y = similar(x, promote_type(xT, wT, bT), output_size(cdims)..., channels_out(cdims), size(x,N))

src/dim_helpers/ConvDims.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export ConvDims
2-
31
"""
42
ConvDims
53

src/dim_helpers/DenseConvDims.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export DenseConvDims
2-
31
"""
42
DenseConvDims
53

src/dim_helpers/DepthwiseConvDims.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export DepthwiseConvDims
2-
31
"""
42
DepthwiseConvDims
53

src/dim_helpers/PoolDims.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export PoolDims
2-
31
"""
42
PoolDims(x_size::NTuple{M}, k::Union{NTuple{L, Int}, Int};
53
stride=k, padding=0, dilation=1) where {M, L}

src/padding.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export pad_constant, pad_repeat, pad_reflect, pad_zeros
2-
31
"""
42
pad_zeros(x, pad::Tuple; [dims])
53
pad_zeros(x, pad::Int; [dims])

0 commit comments

Comments
 (0)