-
Notifications
You must be signed in to change notification settings - Fork 114
add group convolution, depthwise convolution and tests #235
Conversation
894ecf8
to
306e443
Compare
cinn/hlir/op/nn.cc
Outdated
CHECK_EQ(padding.size(), 2) << "The size of padding in conv2d op is not 2! Please check."; | ||
CHECK_EQ(stride.size(), 2) << "The size of stride in conv2d op is not 2! Please check."; | ||
CHECK_GE(inputs_shape[0].size(), 3) << "The first input tensor's shape size of conv2d op is < 3! Please check."; | ||
CHECK(data_format == "NCHW" || data_format == "NHWC") << "only support NCHW/NHWC data_format.\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上面的 if,else if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done,thanks~
cinn/hlir/pe/nn.cc
Outdated
CHECK_EQ(4, output_shapes[2].size()) << "The size of output_shapes[2] of Conv2d op is not 4! Please check."; | ||
std::vector<Expr> output_shape{ | ||
Expr(output_shapes[2][0]), Expr(output_shapes[2][1]), Expr(output_shapes[2][2]), Expr(output_shapes[2][3])}; | ||
CHECK_EQ(4, input->shape.size()) << "Input's dimension of Conv2d_NCHW op is not 4! Please check."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不需要把 4 放到前面,不同于 4==a
,这里顺序不会有 bug,但可读性还是放到后面好一些
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done,thanks~
cinn/hlir/pe/nn.cc
Outdated
std::vector<Expr> input_pad_shape; | ||
if (output_shapes.size() == 3) { | ||
// already computed by infer_shape | ||
CHECK_EQ(4, output_shapes[0].size()) << "The size of output_shapes[0] of Conv2d op is not 4! Please check."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done,thanks~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
add group convolution and nhwc data_format support for the former convolution op
add depthwise convolution op and PEs
add tests(#138 )