I have a very simple example:
import tensorflow as tf
import pdb
number_features = tf.random_uniform((4096,22))
probs = number_features
probs_L = probs[:,:3]
probs_S1 = probs[:,3:12]
probs_S2 = probs[:,12:22]
confidence_no_digits = probs_L[:,0]
confidence_single_digit = probs_L[:,1] * probs_S1
with tf.Session() as sess:
result = sess.run([confidence_single_digit])
However this gives:
ValueError: Dimensions must be equal, but are 4096 and 9 for 'mul' (op: 'Mul') with input shapes: [4096], [4096,9].
Why can I not multiply the vector of size [4096] and a matrix of size [4096,9] element-wise. Why does broadcasting not work here?