From 34b79d9459b705ca86a22bb2cca605418d7f409b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=98=8E=E5=86=AC?= <78149749+winter-wang@users.noreply.github.com> Date: Wed, 16 Jun 2021 21:24:08 +0800 Subject: [PATCH] pass enhance: fix the sequence_conv.pbtxt error, test=develop (#33603) --- .../framework/ir/op_compat_sensible_pass.cc | 2 +- .../{seqconv.pbtxt => sequence_conv.pbtxt} | 39 ++++++++++++++----- 2 files changed, 30 insertions(+), 11 deletions(-) rename paddle/fluid/operators/compat/{seqconv.pbtxt => sequence_conv.pbtxt} (54%) diff --git a/paddle/fluid/framework/ir/op_compat_sensible_pass.cc b/paddle/fluid/framework/ir/op_compat_sensible_pass.cc index 496d06cc331..cbb12839362 100644 --- a/paddle/fluid/framework/ir/op_compat_sensible_pass.cc +++ b/paddle/fluid/framework/ir/op_compat_sensible_pass.cc @@ -117,7 +117,7 @@ InputOrOutputCompat& InputOrOutputCompat::IsOptional() { bool InputOrOutputCompat::operator()( const std::vector& input) const { - if (input.empty()) return false; + if (input.empty()) return optional_; for (auto& func : conditions_) { if (!func(input)) { return false; diff --git a/paddle/fluid/operators/compat/seqconv.pbtxt b/paddle/fluid/operators/compat/sequence_conv.pbtxt similarity index 54% rename from paddle/fluid/operators/compat/seqconv.pbtxt rename to paddle/fluid/operators/compat/sequence_conv.pbtxt index d05aabcc0aa..c5335a25c55 100644 --- a/paddle/fluid/operators/compat/seqconv.pbtxt +++ b/paddle/fluid/operators/compat/sequence_conv.pbtxt @@ -12,23 +12,42 @@ def { outputs { name: "Out" } -} -extra { attrs { - name: "paddingTrainable" - type: BOOLEAN - } - attrs { name: "contextLength" type: INT } - attrs { + attrs { name: "contextStart" type: INT } - attrs { + attrs { name: "contextStride" type: INT - } - + } +} +extra { + attrs { + name: "paddingTrainable" + type: BOOLEAN + } + attrs { + name: "op_role" + type: INT + } + attrs { + name: "op_role_var" + type: STRINGS + } + attrs { + name: "op_namescope" + type: STRING + } + attrs { + name: "op_callstack" + type: STRINGS + } + attrs { + name: "op_device" + type: STRING + } } -- GitLab