File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,6 @@ void ConvOp::InferShape(framework::InferShapeContext* ctx) const {
3131 std::vector<int > paddings = ctx->Attrs ().Get <std::vector<int >>(" paddings" );
3232 int groups = ctx->Attrs ().Get <int >(" groups" );
3333 std::vector<int > dilations = ctx->Attrs ().Get <std::vector<int >>(" dilations" );
34- int input_channels = in_dims[1 ];
35- int output_channels = filter_dims[0 ];
3634
3735 PADDLE_ENFORCE (in_dims.size () == 4 || in_dims.size () == 5 ,
3836 " Conv intput should be 4-D or 5-D tensor." );
@@ -45,9 +43,13 @@ void ConvOp::InferShape(framework::InferShapeContext* ctx) const {
4543 PADDLE_ENFORCE_EQ (
4644 paddings.size (), strides.size (),
4745 " Conv paddings dimension and Conv strides dimension should be the same." );
46+
47+ int input_channels = in_dims[1 ];
4848 PADDLE_ENFORCE_EQ (input_channels, filter_dims[1 ] * groups,
4949 " The number of input channels should be equal to filter "
5050 " channels * groups." );
51+
52+ int output_channels = filter_dims[0 ];
5153 PADDLE_ENFORCE_EQ (
5254 output_channels % groups, 0 ,
5355 " The number of output channels should be divided by groups." );
You can’t perform that action at this time.
0 commit comments