File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -480,8 +480,10 @@ class Pad2dOp : public framework::OperatorWithKernel {
480
480
PADDLE_ENFORCE_EQ (
481
481
paddings_dim.size (), 1 ,
482
482
" Size of Input(Paddings)'s dimension should be equal to 1." );
483
- PADDLE_ENFORCE_EQ (paddings_dim[0 ], 4 ,
484
- " Shape of Input(Paddings) should be equal to [4]." );
483
+ if (ctx->IsRuntime ()) {
484
+ PADDLE_ENFORCE_EQ (paddings_dim[0 ], 4 ,
485
+ " Shape of Input(Paddings) should be equal to [4]." );
486
+ }
485
487
out_dims[1 ] = x_dim[1 ];
486
488
out_dims[2 ] = x_dim[2 ];
487
489
out_dims[3 ] = x_dim[3 ];
@@ -501,11 +503,7 @@ class Pad2dOp : public framework::OperatorWithKernel {
501
503
}
502
504
503
505
ctx->SetOutputDim (" Out" , framework::make_ddim (out_dims));
504
- if (out_dims[0 ] == x_dim[0 ]) {
505
- // Only pass LoD when the first dimension is equal between
506
- // output and input.
507
- ctx->ShareLoD (" X" , /* ->*/ " Out" );
508
- }
506
+ ctx->ShareLoD (" X" , /* ->*/ " Out" );
509
507
}
510
508
511
509
protected:
You can’t perform that action at this time.
0 commit comments