From 4540456b3a8d0c7474e3ae971ce2f16dec5bb904 Mon Sep 17 00:00:00 2001 From: cc <52520497+juncaipeng@users.noreply.github.com> Date: Mon, 31 May 2021 17:49:35 +0800 Subject: [PATCH] Add the op def for conv2d, hard_swish, leaky_relu, relu and swish (#33212) --- paddle/fluid/operators/compat/conv2d.pbtxt | 149 ++++++++++++++++++ .../fluid/operators/compat/hard_swish.pbtxt | 44 ++++++ .../fluid/operators/compat/leaky_relu.pbtxt | 40 +++++ paddle/fluid/operators/compat/relu6.pbtxt | 40 +++++ paddle/fluid/operators/compat/swish.pbtxt | 40 +++++ 5 files changed, 313 insertions(+) create mode 100644 paddle/fluid/operators/compat/conv2d.pbtxt create mode 100644 paddle/fluid/operators/compat/hard_swish.pbtxt create mode 100644 paddle/fluid/operators/compat/leaky_relu.pbtxt create mode 100644 paddle/fluid/operators/compat/relu6.pbtxt create mode 100644 paddle/fluid/operators/compat/swish.pbtxt diff --git a/paddle/fluid/operators/compat/conv2d.pbtxt b/paddle/fluid/operators/compat/conv2d.pbtxt new file mode 100644 index 00000000000..94073800f72 --- /dev/null +++ b/paddle/fluid/operators/compat/conv2d.pbtxt @@ -0,0 +1,149 @@ +type: "conv2d" +def { + inputs { + name: "Input" + } + inputs { + name: "Filter" + } + inputs { + name: "Bias" + } + outputs { + name: "Output" + } + attrs { + name: "strides" + type: INTS + } + attrs { + name: "paddings" + type: INTS + } + attrs { + name: "padding_algorithm" + type: STRING + } + attrs { + name: "groups" + type: INT + } + attrs { + name: "dilations" + type: INTS + } +} +extra { + inputs { + name: "ResidualData" + } + attrs { + name: "is_test" + type: BOOLEAN + } + attrs { + name: "use_cudnn" + type: BOOLEAN + } + attrs { + name: "fuse_relu_before_depthwise_conv" + type: BOOLEAN + } + attrs { + name: "use_mkldnn" + type: BOOLEAN + } + attrs { + name: "use_quantizer" + type: BOOLEAN + } + attrs { + name: "mkldnn_data_type" + type: STRING + } + attrs { + name: "fuse_relu" + type: BOOLEAN + } + attrs { + name: "fuse_brelu" + type: BOOLEAN + } + attrs { + name: "fuse_brelu_threshold" + type: FLOAT + } + attrs { + name: "fuse_activation" + type: STRING + } + attrs { + name: "fuse_alpha" + type: FLOAT + } + attrs { + name: "fuse_beta" + type: FLOAT + } + attrs { + name: "use_addto" + type: BOOLEAN + } + attrs { + name: "fuse_residual_connection" + type: BOOLEAN + } + attrs { + name: "Scale_in" + type: FLOAT + } + attrs { + name: "Scale_out" + type: FLOAT + } + attrs { + name: "Scale_in_eltwise" + type: FLOAT + } + attrs { + name: "Scale_weights" + type: FLOATS + } + attrs { + name: "force_fp32_output" + type: BOOLEAN + } + attrs { + name: "data_format" + type: STRING + } + attrs { + name: "workspace_size_MB" + type: INT + } + attrs { + name: "exhaustive_search" + 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/hard_swish.pbtxt b/paddle/fluid/operators/compat/hard_swish.pbtxt new file mode 100644 index 00000000000..ccf387652ed --- /dev/null +++ b/paddle/fluid/operators/compat/hard_swish.pbtxt @@ -0,0 +1,44 @@ +type: "hard_swish" +def { + inputs { + name: "X" + } + outputs { + name: "Out" + } + attrs { + name: "threshold" + type: FLOAT + } + attrs { + name: "scale" + type: FLOAT + } + attrs { + name: "offset" + type: FLOAT + } +} +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/leaky_relu.pbtxt b/paddle/fluid/operators/compat/leaky_relu.pbtxt new file mode 100644 index 00000000000..9df2e591611 --- /dev/null +++ b/paddle/fluid/operators/compat/leaky_relu.pbtxt @@ -0,0 +1,40 @@ +type: "leaky_relu" +def { + inputs { + name: "X" + } + outputs { + name: "Out" + } + attrs { + name: "alpha" + type: FLOAT + } +} +extra { + attrs { + name: "use_mkldnn" + 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/relu6.pbtxt b/paddle/fluid/operators/compat/relu6.pbtxt new file mode 100644 index 00000000000..edd29037324 --- /dev/null +++ b/paddle/fluid/operators/compat/relu6.pbtxt @@ -0,0 +1,40 @@ +type: "relu6" +def { + inputs { + name: "X" + } + outputs { + name: "Out" + } +} +extra { + attrs { + name: "threshold" + type: FLOAT + } + attrs { + name: "use_mkldnn" + 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/swish.pbtxt b/paddle/fluid/operators/compat/swish.pbtxt new file mode 100644 index 00000000000..4f5ec127e48 --- /dev/null +++ b/paddle/fluid/operators/compat/swish.pbtxt @@ -0,0 +1,40 @@ +type: "swish" +def { + inputs { + name: "X" + } + outputs { + name: "Out" + } +} +extra { + attrs { + name: "beta" + type: FLOAT + } + attrs { + name: "use_mkldnn" + 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