[mocotest-tf] test case for custom op (#4078)
author윤현식/On-Device Lab(SR)/Principal Engineer/삼성전자 <hyunsik.yoon@samsung.com>
Thu, 4 Jul 2019 04:49:14 +0000 (13:49 +0900)
committer박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Thu, 4 Jul 2019 04:49:14 +0000 (13:49 +0900)
* [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 <hyunsik.yoon@samsung.com>
* move into new resource dir

res/TensorFlowTests/CustomOp_000/model.meta.pbtxt [new file with mode: 0644]
res/TensorFlowTests/CustomOp_000/test.info [new file with mode: 0644]
res/TensorFlowTests/CustomOp_000/test.pbtxt [new file with mode: 0644]

diff --git a/res/TensorFlowTests/CustomOp_000/model.meta.pbtxt b/res/TensorFlowTests/CustomOp_000/model.meta.pbtxt
new file mode 100644 (file)
index 0000000..a0d74ac
--- /dev/null
@@ -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 (file)
index 0000000..e3e2b17
--- /dev/null
@@ -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 (file)
index 0000000..373f5b8
--- /dev/null
@@ -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
+    }
+  }
+}