import tensorflow as tf

            value = self.data_dict[name][idx]
        else:
            value = initial_value

        if self.trainable:
            var = tf.get_variable(name = var_name, initializer=value, trainable=True)
            # tf.Variable(value, name=var_name)
        else:
            var = tf.constant(value, dtype=tf.float32, name=var_name)

        self.var_dict[(name, idx)] = var
        # print var_name, var.get_shape().as_list()
        assert var.get_shape() == initial_value.get_shape()

        return var

