import tensorflow as tf
t = tf.constant([[[1, 1, 1], [2, 2, 2],[3, 3, 3], [4, 4, 4],[5, 5, 5], [6, 6, 6],[7, 7, 7], [8, 8, 8]],
[[3, 3, 3], [4, 4, 4],[3, 3, 3], [4, 4, 4],[3, 3, 3], [4, 4, 4],[3, 3, 3], [4, 5, 4]]])
print(t.shape)
nt = tf.concat([tf.concat([tf.reduce_sum(tf.slice(t, [j, i, 0], [1, 2, 3]),axis=1) for i in list(range(0,8,2))],axis=0) for j in range(2)],axis=0)
sess = tf.Session()
sess.run(nt)
(2, 8, 3)
array([[ 3, 3, 3],
[ 7, 7, 7],
[11, 11, 11],
[15, 15, 15],
[ 7, 7, 7],
[ 7, 7, 7],
[ 7, 7, 7],
[ 7, 8, 7]], dtype=int32)