This adds test models for fusing DepthwiseConv with other ops.
Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
--- /dev/null
+input, input:0, TF_FLOAT, [1, 11, 7, 3]
+output, output/relu:0, TF_FLOAT, [1, 6, 4, 12]
--- /dev/null
+SUMMARY: DepthwiseConv2D + Relu
--- /dev/null
+# DepthwiseConv2dNative node is borrowed from UNIT_DepthwiseConv2dNative_000.
+node {
+ name: "input"
+ op: "Placeholder"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 11
+ }
+ dim {
+ size: 7
+ }
+ dim {
+ size: 3
+ }
+ }
+ }
+ }
+}
+node {
+ name: "Const"
+ op: "Const"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 2
+ }
+ dim {
+ size: 3
+ }
+ dim {
+ size: 3
+ }
+ dim {
+ size: 4
+ }
+ }
+ float_val: 1.0
+ }
+ }
+ }
+}
+node {
+ name: "DepthwiseConv2dNative"
+ op: "DepthwiseConv2dNative"
+ input: "input"
+ input: "Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "data_format"
+ value {
+ s: "NHWC"
+ }
+ }
+ attr {
+ key: "dilations"
+ value {
+ list {
+ i: 1
+ i: 1
+ i: 1
+ i: 1
+ }
+ }
+ }
+ attr {
+ key: "padding"
+ value {
+ s: "SAME"
+ }
+ }
+ attr {
+ key: "strides"
+ value {
+ list {
+ i: 1
+ i: 2
+ i: 2
+ i: 1
+ }
+ }
+ }
+}
+
+node {
+ name: "output/relu"
+ op: "Relu"
+ input: "DepthwiseConv2dNative"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+}
--- /dev/null
+input, input:0, TF_FLOAT, [1, 11, 7, 3]
+output, add:0, TF_FLOAT, [1, 6, 4, 12]
--- /dev/null
+SUMMARY: DepthwiseConv2D + Add
--- /dev/null
+# DepthwiseConv2dNative node is borrowed from UNIT_DepthwiseConv2dNative_000.
+node {
+ name: "input"
+ op: "Placeholder"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 11
+ }
+ dim {
+ size: 7
+ }
+ dim {
+ size: 3
+ }
+ }
+ }
+ }
+}
+node {
+ name: "Const"
+ op: "Const"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 2
+ }
+ dim {
+ size: 3
+ }
+ dim {
+ size: 3
+ }
+ dim {
+ size: 4
+ }
+ }
+ float_val: 1.0
+ }
+ }
+ }
+}
+node {
+ name: "DepthwiseConv2dNative"
+ op: "DepthwiseConv2dNative"
+ input: "input"
+ input: "Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "data_format"
+ value {
+ s: "NHWC"
+ }
+ }
+ attr {
+ key: "dilations"
+ value {
+ list {
+ i: 1
+ i: 1
+ i: 1
+ i: 1
+ }
+ }
+ }
+ attr {
+ key: "padding"
+ value {
+ s: "SAME"
+ }
+ }
+ attr {
+ key: "strides"
+ value {
+ list {
+ i: 1
+ i: 2
+ i: 2
+ i: 1
+ }
+ }
+ }
+}
+
+node {
+ name: "add_const"
+ op: "Const"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 12
+ }
+ }
+ float_val: 1.0
+ }
+ }
+ }
+}
+node {
+ name: "add"
+ op: "Add"
+ input: "DepthwiseConv2dNative"
+ input: "add_const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+}
--- /dev/null
+input, input:0, TF_FLOAT, [1, 11, 7, 3]
+output, output/relu:0, TF_FLOAT, [1, 6, 4, 12]
--- /dev/null
+SUMMARY: DepthwiseConv2D + BiasAdd + Relu
--- /dev/null
+# DepthwiseConv2dNative node is borrowed from UNIT_DepthwiseConv2dNative_000.
+node {
+ name: "input"
+ op: "Placeholder"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 11
+ }
+ dim {
+ size: 7
+ }
+ dim {
+ size: 3
+ }
+ }
+ }
+ }
+}
+node {
+ name: "Const"
+ op: "Const"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 2
+ }
+ dim {
+ size: 3
+ }
+ dim {
+ size: 3
+ }
+ dim {
+ size: 4
+ }
+ }
+ float_val: 1.0
+ }
+ }
+ }
+}
+node {
+ name: "DepthwiseConv2dNative"
+ op: "DepthwiseConv2dNative"
+ input: "input"
+ input: "Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "data_format"
+ value {
+ s: "NHWC"
+ }
+ }
+ attr {
+ key: "dilations"
+ value {
+ list {
+ i: 1
+ i: 1
+ i: 1
+ i: 1
+ }
+ }
+ }
+ attr {
+ key: "padding"
+ value {
+ s: "SAME"
+ }
+ }
+ attr {
+ key: "strides"
+ value {
+ list {
+ i: 1
+ i: 2
+ i: 2
+ i: 1
+ }
+ }
+ }
+}
+
+node {
+ name: "bias_const"
+ op: "Const"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 12
+ }
+ }
+ float_val: 1.0
+ }
+ }
+ }
+}
+node {
+ name: "biasadd"
+ op: "BiasAdd"
+ input: "DepthwiseConv2dNative"
+ input: "bias_const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "data_format"
+ value {
+ s: "NHWC"
+ }
+ }
+}
+
+node {
+ name: "output/relu"
+ op: "Relu"
+ input: "biasadd"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+}
--- /dev/null
+input, input:0, TF_FLOAT, [1, 11, 7, 3]
+output, output/relu:0, TF_FLOAT, [1, 6, 4, 12]
--- /dev/null
+SUMMARY: DepthwiseConv2D + Sub (scalar) + Relu
--- /dev/null
+# DepthwiseConv2dNative node is borrowed from UNIT_DepthwiseConv2dNative_000.
+node {
+ name: "input"
+ op: "Placeholder"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 11
+ }
+ dim {
+ size: 7
+ }
+ dim {
+ size: 3
+ }
+ }
+ }
+ }
+}
+node {
+ name: "Const"
+ op: "Const"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 2
+ }
+ dim {
+ size: 3
+ }
+ dim {
+ size: 3
+ }
+ dim {
+ size: 4
+ }
+ }
+ float_val: 1.0
+ }
+ }
+ }
+}
+node {
+ name: "DepthwiseConv2dNative"
+ op: "DepthwiseConv2dNative"
+ input: "input"
+ input: "Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "data_format"
+ value {
+ s: "NHWC"
+ }
+ }
+ attr {
+ key: "dilations"
+ value {
+ list {
+ i: 1
+ i: 1
+ i: 1
+ i: 1
+ }
+ }
+ }
+ attr {
+ key: "padding"
+ value {
+ s: "SAME"
+ }
+ }
+ attr {
+ key: "strides"
+ value {
+ list {
+ i: 1
+ i: 2
+ i: 2
+ i: 1
+ }
+ }
+ }
+}
+
+node {
+ name: "sub_scalar_const"
+ op: "Const"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ float_val: 1.0
+ }
+ }
+ }
+}
+node {
+ name: "sub"
+ op: "Sub"
+ input: "DepthwiseConv2dNative"
+ input: "sub_scalar_const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+}
+
+node {
+ name: "output/relu"
+ op: "Relu"
+ input: "sub"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+}