We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 30147d7 commit 50b6e4cCopy full SHA for 50b6e4c
paddle/fluid/operators/expand_op.cc
@@ -114,7 +114,12 @@ class ExpandGradOp : public framework::OperatorWithKernel {
114
ctx->Attrs().Get<std::vector<int>>("expand_times");
115
auto out_dims = ctx->GetInputDim(framework::GradVarName("Out"));
116
117
- for (size_t i = 0; i < expand_times.size(); ++i) {
+ size_t start_pos = 0u;
118
+ if (!ctx->IsRuntime()) {
119
+ start_pos = 1u;
120
+ }
121
+
122
+ for (size_t i = start_pos; i < expand_times.size(); ++i) {
123
PADDLE_ENFORCE_EQ(x_dims[i] * expand_times[i], out_dims[i],
124
"Each dimension size of Input(Out@GRAD) should be "
125
"equal to multiplication of crroresponding dimension "
0 commit comments