Skip to content

Commit 93e4fee

Browse files
authored
Merge pull request #101 from FluxML/sf/loop_ordering
Fix loop ordering problem in reference conv implementation
2 parents f4a77c0 + 58b248b commit 93e4fee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/impl/conv_direct.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ conv_direct!
6868
# explicit formulation of convolution. Oh hoisting gods, hear my plea.
6969
@inbounds for batch in 1:size(x)[end],
7070
c_out in 1:out_c,
71+
d_idx in 1:out_depth,
7172
h_idx in 1:out_height,
72-
w_idx in 1:out_width,
73-
d_idx in 1:out_depth
73+
w_idx in 1:out_width
7474

7575
# Starting points of the window of x we're going to grab
7676
x_w = project(w_idx, stride_w, pad_w_lo)
@@ -145,4 +145,4 @@ Calculate the gradient imposed upon `w` in the convolution `y = x * w`.
145145
dw .= dw[end:-1:1, end:-1:1, end:-1:1, :, :]
146146
end
147147
return dw
148-
end
148+
end

0 commit comments

Comments
 (0)