I am new tensorflow. I am trying to implement Linear Regression with custom training, following this tutorial.
But when I try to compute W*x + b
I am getting this error
tf.add(tf.matmul(W,x),b)
InvalidArgumentError: cannot compute Add as input #1(zero-based) was expected to be a double tensor but is a float tensor [Op:Add]
I initialized W and b
W = tf.Variable(np.random.rand(1,9))
b = tf.Variable([1],dtype = tf.float32)
x = tf.Variable(np.random.rand(9,100))
But when I changed the initialisation of b to
b = tf.Variable(np.random.rand(1))
I did not get any error. What is the reason for this?