import tensorflow as tf

                                initializer=tf.random_normal_initializer(stddev=stddev))
            self.b = tf.get_variable('b',[output_dim],
                                initializer=tf.constant_initializer(0.0))

    def __call__(self,input_var,name=None,w=None,b=None,**kwargs) :
        w = w if w is not None else self.w
        b = b if b is not None else self.b

        if( input_var.shape.ndims > 2 ) :
            dims = tf.reduce_prod(tf.shape(input_var)[1:])
            return tf.matmul(tf.reshape(input_var,[-1,dims]),w) + b
        else :
            return tf.matmul(input_var,w)+b
    def get_variables(self):
        return {'w':self.w,'b':self.b}

class WeightNormLinear(object):
    def __init__(self,name,input_dim,output_dim,stddev=0.02,epsilon=1e-10) :
        with tf.variable_scope(name) :
            self.v = tf.get_variable('v',[input_dim, output_dim],
                                     initializer=tf.random_normal_initializer(stddev=stddev))
            self.g = tf.get_variable('g',[output_dim],
                                     initializer=tf.constant_initializer(float('nan')))
            self.b = tf.get_variable('b',[output_dim],
