I'm adding two vectors that I thought were 'reshaped' together and getting a 2d matrix as a result. I expect some type of error here, but didn't get it. I think I understand what's happening, it treated them as if there were two more sets of each vector horizontally and vertically, but I don't understand why the results of a and b aren't different. And if they're not meant to be, why does this work at all?
import tensorflow as tf
import numpy as np
start_vec = np.array((83,69,45))
a = tf.expand_dims(start_vec, 0)
b = tf.expand_dims(start_vec, 1)
ab_sum = a + b
init = tf.global_variables_initializer()
with tf.Session() as sess:
sess.run(init)
a = sess.run(a)
b = sess.run(b)
ab_sum = sess.run(ab_sum)
print(a)
print(b)
print(ab_sum)
=================================================
[[83 69 45]]
[[83]
[69]
[45]]
[[166 152 128]
[152 138 114]
[128 114 90]]