From c5c373204d353358d4603abae20fa44b793abe05 Mon Sep 17 00:00:00 2001 From: Wilber Date: Mon, 7 Jun 2021 16:23:27 +0800 Subject: [PATCH] add op_def for gru, lstm and layer_norm (#33317) * add op_def for gru, lstm and layer_norm * fix no newline flag --- paddle/fluid/operators/compat/gru.pbtxt | 65 +++++++++++++++++ .../fluid/operators/compat/layer_norm.pbtxt | 63 ++++++++++++++++ paddle/fluid/operators/compat/lstm.pbtxt | 72 +++++++++++++++++++ 3 files changed, 200 insertions(+) create mode 100644 paddle/fluid/operators/compat/gru.pbtxt create mode 100644 paddle/fluid/operators/compat/layer_norm.pbtxt create mode 100644 paddle/fluid/operators/compat/lstm.pbtxt diff --git a/paddle/fluid/operators/compat/gru.pbtxt b/paddle/fluid/operators/compat/gru.pbtxt new file mode 100644 index 0000000000..38aa8a92f7 --- /dev/null +++ b/paddle/fluid/operators/compat/gru.pbtxt @@ -0,0 +1,65 @@ +type: "gru" +def { + inputs { + name: "Input" + } + inputs { + name: "H0" + } + inputs { + name: "Weight" + } + inputs { + name: "Bias" + } + outputs { + name: "BatchGate" + } + outputs { + name: "BatchResetHiddenPrev" + } + outputs { + name: "BatchHidden" + } + outputs { + name: "Hidden" + } + attrs { + name: "activation" + type: STRING + } + attrs { + name: "gate_activation" + type: STRING + } + attrs { + name: "is_reverse" + type: BOOLEAN + } + attrs { + name: "origin_mode" + type: BOOLEAN + } +} +extra { + 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 + } +} diff --git a/paddle/fluid/operators/compat/layer_norm.pbtxt b/paddle/fluid/operators/compat/layer_norm.pbtxt new file mode 100644 index 0000000000..dbb78e0a8b --- /dev/null +++ b/paddle/fluid/operators/compat/layer_norm.pbtxt @@ -0,0 +1,63 @@ +type: "layer_norm" +def { + inputs { + name: "X" + } + inputs { + name: "Scale" + } + inputs { + name: "Bias" + } + outputs { + name: "Y" + } + outputs { + name: "Mean" + } + outputs { + name: "Variance" + } + attrs { + name: "epsilon" + type: FLOAT + } + attrs { + name: "begin_norm_axis" + type: INT + } +} +extra { + attrs { + name: "use_mkldnn" + type: BOOLEAN + } + attrs { + name: "mkldnn_data_type" + type: STRING + } + attrs { + name: "is_test" + 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 + } +} diff --git a/paddle/fluid/operators/compat/lstm.pbtxt b/paddle/fluid/operators/compat/lstm.pbtxt new file mode 100644 index 0000000000..889911a840 --- /dev/null +++ b/paddle/fluid/operators/compat/lstm.pbtxt @@ -0,0 +1,72 @@ +type: "lstm" +def { + inputs { + name: "Input" + } + inputs { + name: "H0" + } + inputs { + name: "C0" + } + inputs { + name: "Weight" + } + inputs { + name: "Bias" + } + outputs { + name: "Hidden" + } + outputs { + name: "Cell" + } + outputs { + name: "BatchGate" + } + outputs { + name: "BatchCellPreAct" + } + attrs { + name: "use_peepholes" + type: BOOLEAN + } + attrs { + name: "is_reverse" + type: BOOLEAN + } + attrs { + name: "gate_activation" + type: STRING + } + attrs { + name: "cell_activation" + type: STRING + } + attrs { + name: "candidate_activation" + type: STRING + } +} +extra { + 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