In [ ]:
# Created 2016-04-03
# Tensorflow version: 0.7
In [ ]:
import numpy as np
import tensorflow as tf
In [ ]:
a = tf.constant([[1, 2, 3],
[4, 5, 6]])
b = tf.constant([[7, 8, 9],
[0, 1, 2]])
# Concat on first dimension gives
# [[1 2 3]
# [4 5 6]
# [7 8 9]
# [0 1 2]]
c = tf.concat(0, [a, b])
# Concat on first dimension gives
# [[1 2 3 7 8 9]
# [4 5 6 0 1 2]]
d = tf.concat(1, [a, b])
with tf.Session() as sess:
eval_c, eval_d = sess.run([c, d])
print(eval_c)
print(eval_d)