diff options
author | Chunseok Lee <chunseok.lee@samsung.com> | 2020-12-14 14:43:04 +0900 |
---|---|---|
committer | Chunseok Lee <chunseok.lee@samsung.com> | 2020-12-14 14:43:04 +0900 |
commit | 12d88feea8573f8490629cf62fc342b152e57d65 (patch) | |
tree | 3c734cc4d629834d2d523f4575ef84cd64684e57 /res/TensorFlowTests/NET_YUV_TO_RGB | |
parent | d6b371e095d737922187a518b8faba1ef6f3a2b1 (diff) | |
download | nnfw-12d88feea8573f8490629cf62fc342b152e57d65.tar.gz nnfw-12d88feea8573f8490629cf62fc342b152e57d65.tar.bz2 nnfw-12d88feea8573f8490629cf62fc342b152e57d65.zip |
Imported Upstream version 1.11.0upstream/1.11.0
Diffstat (limited to 'res/TensorFlowTests/NET_YUV_TO_RGB')
-rw-r--r-- | res/TensorFlowTests/NET_YUV_TO_RGB/circle.rule | 5 | ||||
-rw-r--r-- | res/TensorFlowTests/NET_YUV_TO_RGB/test.info | 2 | ||||
-rw-r--r-- | res/TensorFlowTests/NET_YUV_TO_RGB/test.manifest | 1 | ||||
-rw-r--r-- | res/TensorFlowTests/NET_YUV_TO_RGB/test.pbtxt | 184 | ||||
-rw-r--r-- | res/TensorFlowTests/NET_YUV_TO_RGB/test.py | 14 |
5 files changed, 206 insertions, 0 deletions
diff --git a/res/TensorFlowTests/NET_YUV_TO_RGB/circle.rule b/res/TensorFlowTests/NET_YUV_TO_RGB/circle.rule new file mode 100644 index 000000000..44d52aaff --- /dev/null +++ b/res/TensorFlowTests/NET_YUV_TO_RGB/circle.rule @@ -0,0 +1,5 @@ +# tf2circle-dredd-pbtxt-test for YUV to RGB conversion + +RULE "VERIFY_FILE_FORMAT" $(verify_file_format) '=' 1 # 1 means verification is OK + +RULE "ALL_OP_COUNT" $(all_op_count) '=' 3 diff --git a/res/TensorFlowTests/NET_YUV_TO_RGB/test.info b/res/TensorFlowTests/NET_YUV_TO_RGB/test.info new file mode 100644 index 000000000..92e150d86 --- /dev/null +++ b/res/TensorFlowTests/NET_YUV_TO_RGB/test.info @@ -0,0 +1,2 @@ +input, x:0, TF_FLOAT, [1, 4, 4, 3] +output, Identity:0, TF_FLOAT, [1, 4, 4, 3] diff --git a/res/TensorFlowTests/NET_YUV_TO_RGB/test.manifest b/res/TensorFlowTests/NET_YUV_TO_RGB/test.manifest new file mode 100644 index 000000000..3d4f7b98a --- /dev/null +++ b/res/TensorFlowTests/NET_YUV_TO_RGB/test.manifest @@ -0,0 +1 @@ +SUMMARY: YUV_TO_RGB test as a graph diff --git a/res/TensorFlowTests/NET_YUV_TO_RGB/test.pbtxt b/res/TensorFlowTests/NET_YUV_TO_RGB/test.pbtxt new file mode 100644 index 000000000..3296f9919 --- /dev/null +++ b/res/TensorFlowTests/NET_YUV_TO_RGB/test.pbtxt @@ -0,0 +1,184 @@ +node { + name: "x" + op: "Placeholder" + attr { + key: "_user_specified_name" + value { + s: "x" + } + } + attr { + key: "dtype" + value { + type: DT_FLOAT + } + } + attr { + key: "shape" + value { + shape { + dim { + size: 1 + } + dim { + size: 4 + } + dim { + size: 4 + } + dim { + size: 3 + } + } + } + } +} +node { + name: "kernel" + op: "Const" + attr { + key: "dtype" + value { + type: DT_FLOAT + } + } + attr { + key: "value" + value { + tensor { + dtype: DT_FLOAT + tensor_shape { + dim { + size: 3 + } + dim { + size: 3 + } + } + tensor_content: "\000\000\200?\000\000\200?\000\000\200?\000\000\000\000\217\016\312\276M\r\002@\260\347\221?\242\243\024\277\000\000\000\000" + } + } + } +} +node { + name: "Tensordot/Reshape/shape" + op: "Const" + attr { + key: "dtype" + value { + type: DT_INT32 + } + } + attr { + key: "value" + value { + tensor { + dtype: DT_INT32 + tensor_shape { + dim { + size: 2 + } + } + tensor_content: "\020\000\000\000\003\000\000\000" + } + } + } +} +node { + name: "Tensordot/Reshape" + op: "Reshape" + input: "x" + input: "Tensordot/Reshape/shape" + attr { + key: "T" + value { + type: DT_FLOAT + } + } + attr { + key: "Tshape" + value { + type: DT_INT32 + } + } +} +node { + name: "Tensordot/MatMul" + op: "MatMul" + input: "Tensordot/Reshape" + input: "kernel" + attr { + key: "T" + value { + type: DT_FLOAT + } + } + attr { + key: "transpose_a" + value { + b: false + } + } + attr { + key: "transpose_b" + value { + b: false + } + } +} +node { + name: "Tensordot/shape" + op: "Const" + attr { + key: "dtype" + value { + type: DT_INT32 + } + } + attr { + key: "value" + value { + tensor { + dtype: DT_INT32 + tensor_shape { + dim { + size: 4 + } + } + tensor_content: "\001\000\000\000\004\000\000\000\004\000\000\000\003\000\000\000" + } + } + } +} +node { + name: "Tensordot" + op: "Reshape" + input: "Tensordot/MatMul" + input: "Tensordot/shape" + attr { + key: "T" + value { + type: DT_FLOAT + } + } + attr { + key: "Tshape" + value { + type: DT_INT32 + } + } +} +node { + name: "Identity" + op: "Identity" + input: "Tensordot" + attr { + key: "T" + value { + type: DT_FLOAT + } + } +} +versions { + producer: 175 +} diff --git a/res/TensorFlowTests/NET_YUV_TO_RGB/test.py b/res/TensorFlowTests/NET_YUV_TO_RGB/test.py new file mode 100644 index 000000000..978976571 --- /dev/null +++ b/res/TensorFlowTests/NET_YUV_TO_RGB/test.py @@ -0,0 +1,14 @@ +#used to create test.pbtxt +# Version info +# - Tensorflow : 2.2.0 +# - Python : 3.7.7 + +import tensorflow as tf +# Construct a basic model. +root = tf.train.Checkpoint() +root.f = tf.function(lambda x: tf.image.yuv_to_rgb(x)) +# Create the concrete function. +input_data = tf.constant(1., shape=[1, 4, 4, 3]) +# dim = tf.constant(12,shape=[2]) +concrete_func = root.f.get_concrete_function(input_data) +tf.io.write_graph(concrete_func.graph.as_graph_def(), '.', 'test.pbtxt') |