Q:

TensorFlow Variable Increase Shape

I'm not sure if this is even possible, but what I want here is that in the first print statement below, I'd get a 3-entry column vector and in the second print statement below, I'd get a 4-entry column vector.
import tensorflow as tf

# Mx = b
M = tf.Variable([[1,2,3],[4,5,6],[7,8,9]],validate_shape=False)
x = tf.Variable([[1],[2],[3]])
b = tf.matmul(M,x)

init = tf.global_variables_initializer()

with tf.Session() as sess:
        sess.run(init)
        print(sess.run(b))
        M.load([[1,2,3],[4,5,6],[7,8,9],[10,11,12]],sess)
        print(sess.run(b))

This code doesn't work since "load" yells about the shape being wrong:

ValueError: Cannot feed value of shape (4, 3) for Tensor
  'Variable/initial_value:0', which has shape '(3, 3)'

Also reshape doesn't work because I want to actually increase the total number of entries in the matrix as well.
Is there any simple way to do this? (preferably without adding many more nodes to my computational graph)
Thanks,
JacKeown

A:

According to the documentation variable shape can not be changed.

The Variable() constructor requires an initial value for the variable, which can be a Tensor of any type and shape. The initial value defines the type and shape of the variable. After construction, the type and shape of the variable are fixed. The value can be changed using one of the assign methods.

(emphasis added)

