Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

add group convolution, depthwise convolution and tests #235

Merged
merged 3 commits into from
Sep 27, 2020

Conversation

wenming2014
Copy link
Collaborator

add group convolution and nhwc data_format support for the former convolution op
add depthwise convolution op and PEs
add tests(#138 )

@wenming2014 wenming2014 force-pushed the wy branch 2 times, most recently from 894ecf8 to 306e443 Compare September 25, 2020 08:41
cinn/hlir/op/nn.cc Show resolved Hide resolved
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";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上面的 if,else if

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done,thanks~

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.";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不需要把 4 放到前面,不同于 4==a ,这里顺序不会有 bug,但可读性还是放到后面好一些

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done,thanks~

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.";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done,thanks~

Copy link
Collaborator

@Superjomn Superjomn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Superjomn Superjomn merged commit fb0683c into PaddlePaddle:develop Sep 27, 2020
@Superjomn Superjomn deleted the wy branch September 27, 2020 02:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants