import tensorflow as tf

    def __call__(self,input_var) :
        mean, var = tf.nn.moments(input_var, self.axis, keep_dims=True)
        return (input_var - mean) / tf.sqrt(var+self.epsilon)

class BatchNorm(object):
    def __init__(self,name,dims,axis=1,epsilon=1e-3,momentum=0.999,center=True,scale=True) :
        self.momentum = momentum
        self.epsilon = epsilon
        self.axis = axis
        self.center=center
        self.scale=scale
        with tf.variable_scope(name) as scope:
            with tf.variable_scope('bn') :
                self.gamma= tf.get_variable('gamma',[dims], initializer=tf.constant_initializer(1.0))
                self.beta = tf.get_variable('beta',[dims], initializer=tf.constant_initializer(0.0))
                self.moving_mean = tf.get_variable('moving_mean',[dims], initializer=tf.constant_initializer(0.0), trainable=False)
                self.moving_variance = tf.get_variable('moving_variance',[dims], initializer=tf.constant_initializer(1.0), trainable=False)
        self.scope = scope

    def __call__(self,input_var,is_training,**xargs) :
        with tf.variable_scope(self.scope) :
            return tf.layers.batch_normalization(
