import tensorflow as tf
indices = [[3], [5], [0], [7]]
indices = tf.concat(0, indices)
indices = tf.reshape(indice, (4, 1))
a = tf.one_hot(indices, depth=10, on_value=None, off_value=None, axis=None, dtype=None, name=None)
print ("a is : ")
print a
b = tf.reshape(a, (4, 10))
print ("a is : ")
print b
'''
a is :
Tensor("one_hot:0", shape=(4, 1, 10), dtype=float32)
a is :
Tensor("Reshape_1:0", shape=(4, 10), dtype=float32)
'''