import tensorflow as tf

                    mean, var = tf.nn.moments(x, [1, 2], keep_dims=True)
                    scale = tf.get_variable('scale',[x.get_shape()[-1]], 
                    initializer=tf.truncated_normal_initializer(mean=1.0, stddev=0.02))
                    offset = tf.get_variable('offset',[x.get_shape()[-1]],initializer=tf.constant_initializer(0.0))
                    out = scale*tf.div(x-mean, tf.sqrt(var+epsilon)) + offset
                    return out
                
    
            def d_layer(layer_input,filters,f_size=4,stride=2,norm=True,name='d_layer'):
                """Discriminator layer"""
                with tf.variable_scope(name):
                    if reuse:
                        tf.get_variable_scope().reuse_variables()
                    else:
                        assert tf.get_variable_scope().reuse is False

                    d = tf.contrib.layers.conv2d(layer_input,filters,kernel_size=f_size,stride=2, padding='SAME')
                    if norm:
                        d = tf.contrib.layers.batch_norm(d)
                    d = lrelu(d,alpha=0.2)
                    return d
    
                
            down1 = d_layer(image,self.df, norm=False,name='down1')  #256x256 -> 128x128
            #rint('down1',np.shape(down1))
            down2 = d_layer(down1,self.df*2,name='down2')         #128x128 -> 64x64
            #rint('down2',np.shape(down2))
            down3 = d_layer(down2,self.df*4,name='down3')         #64x64 -> 32x32 
