@@ -0,0 +1,700 @@
+#!/usr/bin/env python2%0A# -*- coding: UTF-8 -*-%0A# File: symbolic_functions.py%0A# Author: Yuxin Wu %3Cppwwyyxx@gmail.com%3E%0A%0Aimport tensorflow as tf%0Aimport numpy as np%0A__all__ = %5B'one_hot', 'batch_flatten'%5D%0A%0Adef one_hot(y, num_labels):%0A    batch_size = tf.size(y)%0A    y = tf.expand_dims(y, 1)%0A    indices = tf.expand_dims(tf.range(0, batch_size), 1)%0A    concated = tf.concat(1, %5Bindices, y%5D)%0A    onehot_labels = tf.sparse_to_dense(%0A        concated, tf.pack(%5Bbatch_size, num_labels%5D), 1.0, 0.0)%0A    onehot_labels.set_shape(%5BNone, num_labels%5D)%0A    return tf.cast(onehot_labels, tf.float32)%0A%0Adef batch_flatten(x):%0A    total_dim = np.prod(x.get_shape()%5B1:%5D.as_list())%0A    return tf.reshape(x, %5B-1, total_dim%5D)%0A

add missing util