From 36ff6f62f830441988ca78fcb6eb2087890dfac8 Mon Sep 17 00:00:00 2001 From: winter-wang <1030748926@qq.com> Date: Wed, 16 Jun 2021 08:19:33 +0000 Subject: [PATCH] pass enhance: fix the sequence_conv.pbtxt error, test=develop --- .../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 496d06cc331ca..cbb12839362f3 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 d05aabcc0aa40..c5335a25c557a 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 + } }