In [28]:
import tensorflow as tf

In [29]:
N=5

In [30]:
x1 = tf.diag(tf.ones(tf.stack([N, ]), dtype='float32'))

In [31]:
x2 = tf.stack([N, ])

In [37]:
x3 = tf.ones([1]).shape

In [38]:
init_op = tf.global_variables_initializer()

In [39]:
with tf.Session() as sess:
    print(sess.run(0.01*x1))
    print(x2.shape)
    print(x3)


[[ 0.01  0.    0.    0.    0.  ]
 [ 0.    0.01  0.    0.    0.  ]
 [ 0.    0.    0.01  0.    0.  ]
 [ 0.    0.    0.    0.01  0.  ]
 [ 0.    0.    0.    0.    0.01]]
(1,)
(1,)

In [26]:
tf.ones([1])


Out[26]:
<tf.Tensor 'ones_5:0' shape=(1,) dtype=float32>

In [ ]: