diff --git a/paddle/fluid/operators/assign_op.cc b/paddle/fluid/operators/assign_op.cc index d6ab77b6cb85a647e77afebf861068a38cf3b7df..cb47511796c741650dbc472ff4c103fecd338875 100644 --- a/paddle/fluid/operators/assign_op.cc +++ b/paddle/fluid/operators/assign_op.cc @@ -36,6 +36,13 @@ class AssignOp : public framework::OperatorWithKernel { if (type == framework::proto::VarType::LOD_TENSOR) { ctx->ShareLoD("X", /*->*/ "Out"); } + } else if (type == framework::proto::VarType::LOD_TENSOR_ARRAY) { + if (ctx->IsRuntime()) { + // The runtime output shape is determined in kernel. + return; + } else { + ctx->SetOutputDim("Out", ctx->GetInputDim("X")); + } } } }