Set lod_level of Out in compile time of sequence_pool_op (#21604)

paddle_tiny_install
Aurelius84 5 years ago committed by GitHub
parent 346705967d
commit 3d9dee575e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -31,9 +31,11 @@ class SequencePoolOp : public framework::OperatorWithKernel {
if (!ctx->IsRuntime()) {
// Check the lod_level for compile-time.
auto in_lod_level = ctx->GetLoDLevel("X");
PADDLE_ENFORCE_GT(
ctx->GetLoDLevel("X"), 0,
in_lod_level, 0,
"The LoD level Input(X) of sequence_pool should be larger than 0.");
ctx->SetLoDLevel("Out", in_lod_level - 1);
}
ctx->SetOutputDim("Out", ctx->GetInputDim("X"));

Loading…
Cancel
Save