Skip to content

Commit

Permalink
add a few comments on layout after im2col (#12429)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #12429

Comments to clarify layout after NHWC im2col for group convolution.

i-am-not-moving-c2-to-c10

Reviewed By: houseroad

Differential Revision: D10233284

fbshipit-source-id: 996a69f2f932e02c978abaade7571b00741b6ae8
  • Loading branch information
jspark1105 authored and facebook-github-bot committed Nov 4, 2018
1 parent 6b578cd commit f000101
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions caffe2/operators/conv_op_impl.h
Expand Up @@ -264,6 +264,8 @@ bool ConvOp<T, Context>::RunOnDeviceWithOrderNHWC() {
group_);
// Weight term
for (int group_id = 0; group_id < group_; ++group_id) {
// col_buffer_data in G (H W) (R S C/G) layout
// filter_data in G K/G (R S C/G) layout
math::GemmEx<T, Context>(
CblasNoTrans,
CblasTrans,
Expand Down
2 changes: 2 additions & 0 deletions caffe2/utils/math_cpu.cc
Expand Up @@ -3339,6 +3339,8 @@ C10_EXPORT void Im2Col<float, CPUContext, StorageOrder::NHWC>(
h_pad += stride_h;
} // h
} else {
// img_data in N H W G C/G layout
// col_data in N G H W R S C/G layout
const int C_per_G = C / groups;
for (int h = 0; h < output_h; ++h) {
int w_pad = -pad_l;
Expand Down

0 comments on commit f000101

Please sign in to comment.