Fix bug in assign op: support to infer shape for LOD_TENSOR_ARRAY. (#24268)

revert-24314-dev/fix_err_msg
liym27 5 years ago committed by GitHub
parent b43b46e619
commit 19511dfa25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -36,6 +36,13 @@ class AssignOp : public framework::OperatorWithKernel {
if (type == framework::proto::VarType::LOD_TENSOR) { if (type == framework::proto::VarType::LOD_TENSOR) {
ctx->ShareLoD("X", /*->*/ "Out"); 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"));
}
} }
} }
} }

Loading…
Cancel
Save