From fc4aabf874ef61d3c713bbef406328f8bff4d660 Mon Sep 17 00:00:00 2001 From: jwx930962 Date: Mon, 22 Nov 2021 18:53:14 +0800 Subject: [PATCH] increase parser st --- metadef | 2 +- .../origin_models/conv2d_depthwise_pb_gen.py | 26 +++++++++++++++ tests/st/testcase/origin_models/model.pb | Bin 0 -> 660 bytes .../origin_models/test_conv2d_pb_gen.py | 27 ++++++++++++++++ .../origin_models/test_depth_wise_conv2d.pb | Bin 0 -> 764 bytes tests/st/testcase/test_tensorflow_parser.cc | 30 +++++++++++++++++- 6 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 tests/st/testcase/origin_models/conv2d_depthwise_pb_gen.py create mode 100644 tests/st/testcase/origin_models/model.pb create mode 100644 tests/st/testcase/origin_models/test_conv2d_pb_gen.py create mode 100644 tests/st/testcase/origin_models/test_depth_wise_conv2d.pb diff --git a/metadef b/metadef index 326ecbb..8ad7cbd 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit 326ecbb2b4837699aa674cc30e9b9956e4fd364d +Subproject commit 8ad7cbd3c18d322381583d75c32906f8374a348d diff --git a/tests/st/testcase/origin_models/conv2d_depthwise_pb_gen.py b/tests/st/testcase/origin_models/conv2d_depthwise_pb_gen.py new file mode 100644 index 0000000..7ac9c2d --- /dev/null +++ b/tests/st/testcase/origin_models/conv2d_depthwise_pb_gen.py @@ -0,0 +1,26 @@ +import tensorflow as tf +import os + +pb_file_path = os.getcwd() + +with tf.compat.v1.Session(graph=tf.Graph()) as sess: + # NHWC + fmap_shape = [17, 101, 101, 17] + filter_size = [5, 5, 17, 1] + dy_shape = [17, 49, 49, 17] + strideh, stridew = [2, 2] + padding = 'VALID' + tensor_x1 = tf.compat.v1.placeholder(dtype="float16", shape=fmap_shape) + tensor_x2 = tf.compat.v1.placeholder(dtype="float16", shape=fmap_shape) + tensor_x = tf.add(tensor_x1, tensor_x2) + tensor_dy1 = tf.compat.v1.placeholder(dtype="float16", shape=dy_shape) + tensor_dy2 = tf.compat.v1.placeholder(dtype="float16", shape=dy_shape) + tensor_dy = tf.add(tensor_dy1, tensor_dy2) + + op = tf.nn.depthwise_conv2d_backprop_filter(tensor_x, filter_size, tensor_dy, + strides=[1, strideh, stridew, 1], + padding=padding, + data_format='NHWC', + dilations=[1,1,1,1]) + + tf.io.write_graph(sess.graph, logdir="./", name="test_depth_wise_conv2d.pb", as_text=False) diff --git a/tests/st/testcase/origin_models/model.pb b/tests/st/testcase/origin_models/model.pb new file mode 100644 index 0000000000000000000000000000000000000000..9bd83df10deb9429f51b46e38a50ed3af2f5e6d9 GIT binary patch literal 660 zcmb7B!AiqG5X~k{n@-TmU_s-p#~{R;5PPtCu?MM$c<~T6*~Kob*^o_ZEB=&!=%xW{ z5Q|=Bc82%f%$tQ%AS?9mB+d9-Nyf|22bWdrf}?%rgnQuXIW3rFi3IB${`!q;kR0y;ixd!b9jLnWS1HfQMbFviLG>Z-L-8l>SxEbI^(jfp;J& z`j51{p*fR$R{SC~gaMUOy>gZ?z7!ePXoD3Fpr5I{q9W%d+Gw>0nj18>?br$td{dN0 zAg3=J9V97Sz{ptBTXQTjtF#)k0`X@rFytwCX*AJVJm+}OWCIj5t!)@Uu`vi+k~wO?$^z2ZB*ODV{mR466+9Zqo*uZQodPH=Y^d&Tn&|zS zSU`IuQ$2rCxf~|TRaZ>7Rx3H+)2B2`(y@xQ%v!VZh;sEVb9AXO*VQkw*#)>O9zRPw z8-%`%4moq0b=NSA0s+A!z=s9rTg=04n!?iO&ho=`NW2gzPc{EG11=o0h&gAN0 zNY{r##S{jaMIR1A$E3whAds(VtfopwDHlR5A9J+8U