Skip to content

Commit cbc4d1b

Browse files
authored
Merge pull request #932 from Crayon-new:tf_pooling
add test case for "tf/reduce_sum" * fix output dimension of reduce_sum * add test case and fix bug * add more cases * style:change files name * fix a little bug
1 parent db89432 commit cbc4d1b

31 files changed

+13
-0
lines changed

testdata/dnn/tensorflow/generate_tf_models.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,19 @@ def keras_relu6(x):
594594
inp = tf.placeholder(tf.float32, [2, 3, 4, 5], 'input')
595595
reduced = tf.reduce_sum(inp, axis=[2], keepdims=False)
596596
save(inp, reduced, 'sum_pool_by_axis')
597+
###############################################################################
598+
#This test case generated by tensorflow 1.15.0
599+
axises = [[0], [1], [2], [3], [1, 2]]
600+
for axis in axises:
601+
for keepdims in [False, True]:
602+
inp = tf.placeholder(tf.float32, [2, 3, 4, 1])
603+
biasadd = tf.nn.bias_add(inp, [1], data_format='NHWC')
604+
print(axis, keepdims)
605+
reduced = tf.reduce_sum(biasadd, axis=axis, keepdims=keepdims)
606+
if len(axis) == 1:
607+
save(inp, reduced + 1, f'reduce_sum_{axis[0]}_{keepdims}')
608+
else:
609+
save(inp, reduced + 1, f'reduce_sum_{axis[0]}_{axis[1]}_{keepdims}')
597610
################################################################################
598611
inp = tf.placeholder(tf.float32, [1, 4, 2, 3], 'input')
599612
out = tf.math.reduce_sum(inp, axis=-1)
224 Bytes
Binary file not shown.
454 Bytes
Binary file not shown.
176 Bytes
Binary file not shown.
224 Bytes
Binary file not shown.
480 Bytes
Binary file not shown.
176 Bytes
Binary file not shown.
224 Bytes
Binary file not shown.
487 Bytes
Binary file not shown.
Binary file not shown.
224 Bytes
Binary file not shown.
487 Bytes
Binary file not shown.
136 Bytes
Binary file not shown.
224 Bytes
Binary file not shown.
480 Bytes
Binary file not shown.
160 Bytes
Binary file not shown.
224 Bytes
Binary file not shown.
480 Bytes
Binary file not shown.
160 Bytes
Binary file not shown.
224 Bytes
Binary file not shown.
480 Bytes
Binary file not shown.
152 Bytes
Binary file not shown.
224 Bytes
Binary file not shown.
480 Bytes
Binary file not shown.
152 Bytes
Binary file not shown.
224 Bytes
Binary file not shown.
480 Bytes
Binary file not shown.
224 Bytes
Binary file not shown.
224 Bytes
Binary file not shown.
480 Bytes
Binary file not shown.
224 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)