Skip to content

Commit 737f246

Browse files
committed
Same inference workaround for col2im!() performance.
1 parent 503fd23 commit 737f246

File tree

5 files changed

+383
-4
lines changed

5 files changed

+383
-4
lines changed

src/impl/conv_im2col.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ See the documentation for `conv_im2col!()` for explanation of other parameters.
145145
w_ptr = pointer(w)
146146
col_ptr = pointer(col)
147147
gemm!(Val(false), Val(true), M, N, K, alpha, dy_ptr, w_ptr, T(0), col_ptr)
148-
col2im!(view(dx, :, :, :, :, batch_idx), col, cdims)
148+
@timeit_debug to "col2im!" col2im!(view(dx, :, :, :, :, batch_idx), col, cdims)
149149
end
150150
return dx
151151
end
@@ -287,7 +287,7 @@ desperate enough yet.
287287
"""
288288
col2im!
289289

290-
@timeit_debug to function col2im!(x::AbstractArray{T,4}, col::AbstractArray{T,2},
290+
function col2im!(x::AbstractArray{T,4}, col::AbstractArray{T,2},
291291
cdims::ConvDims) where T
292292
if spatial_dims(cdims) != 3
293293
throw(DimensionMismatch("col2im!() only accepts 3d convoluitional inputs"))

src/impl/depthwiseconv_im2col.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ See the documentation for `conv_im2col!()` for explanation of optional parameter
113113
col_ptr = pointer(col, (cidx - 1)*M*N + 1)
114114
gemm!(Val(false), Val(true), M, N, K, alpha, dy_ptr, w_ptr, T(0), col_ptr)
115115
end
116-
col2im!(view(dx, :, :, :, :, batch_idx), col, cdims)
116+
@timeit_debug to "col2im!" col2im!(view(dx, :, :, :, :, batch_idx), col, cdims)
117117
end
118118
return dx
119119
end

0 commit comments

Comments
 (0)