From 869b677135d31aafdd28280e84566fd436f8216d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9C=A4=ED=98=84=EC=8B=9D/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 4 Jul 2019 13:49:14 +0900 Subject: [PATCH] [mocotest-tf] test case for custom op (#4078) * [mocotest-tf] test case for custom op This is the first testcase for custom op. code for moco/loco extension will be written to pass this test. Signed-off-by: Hyun Sik Yoon * move into new resource dir --- res/TensorFlowTests/CustomOp_000/model.meta.pbtxt | 16 +++++++ res/TensorFlowTests/CustomOp_000/test.info | 2 + res/TensorFlowTests/CustomOp_000/test.pbtxt | 53 +++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 res/TensorFlowTests/CustomOp_000/model.meta.pbtxt create mode 100644 res/TensorFlowTests/CustomOp_000/test.info create mode 100644 res/TensorFlowTests/CustomOp_000/test.pbtxt diff --git a/res/TensorFlowTests/CustomOp_000/model.meta.pbtxt b/res/TensorFlowTests/CustomOp_000/model.meta.pbtxt new file mode 100644 index 0000000..a0d74ac --- /dev/null +++ b/res/TensorFlowTests/CustomOp_000/model.meta.pbtxt @@ -0,0 +1,16 @@ +# defining a list of custom ops for this compilation +custom_op { + name: "my/customOp/000" + op: "new_custom_op" + attr { + key: "output_shape" + value { + shape { + dim { size: 1 } + dim { size: 2 } + dim { size: 1 } + dim { size: 2 } + } + } + } +} diff --git a/res/TensorFlowTests/CustomOp_000/test.info b/res/TensorFlowTests/CustomOp_000/test.info new file mode 100644 index 0000000..e3e2b17 --- /dev/null +++ b/res/TensorFlowTests/CustomOp_000/test.info @@ -0,0 +1,2 @@ +input, Placeholder:0, TF_FLOAT, [1, 2, 1, 2] +output, output/relu:0, TF_FLOAT, [1, 2, 1, 2] diff --git a/res/TensorFlowTests/CustomOp_000/test.pbtxt b/res/TensorFlowTests/CustomOp_000/test.pbtxt new file mode 100644 index 0000000..373f5b8 --- /dev/null +++ b/res/TensorFlowTests/CustomOp_000/test.pbtxt @@ -0,0 +1,53 @@ +node { + name: "Placeholder" + op: "Placeholder" + attr { + key: "dtype" value { type: DT_FLOAT } } + attr { + key: "shape" + value { + shape { + dim { size: 1 } + dim { size: 2 } + dim { size: 1 } + dim { size: 2 } + } + } + } +} +node { + name: "my/customOp/000" + op: "new_custom_op" + input: "Placeholder" + attr { + key: "T" + value { type: DT_FLOAT } + } + attr { + key: "my_string" + value { s: "Hello World" } + } + attr { + key: "my_float" + value { f: 0.001 } + } + attr { + key: "my_int" + value { i: 111 } + } + attr { + key: "my_bool" + value { b: false } + } +} +node { + name: "output/relu" + op: "Relu" + input: "my/customOp/000" + attr { + key: "T" + value { + type: DT_FLOAT + } + } +} -- 2.7.4