import tensorflow as tf

                                       output_shape=shapes,
                                       strides=self.strides,
                                       padding='SAME',
                                       data_format='NHWC')
            mu,var = tf.nn.moments(t,axes=[0,1,2])
            std = tf.sqrt(var+self.epsilon)
            return [tf.assign(self.g,1/std),tf.assign(self.b,-1.*mu/std)]

        require_init = tf.reduce_any(tf.is_nan(self.g))
        init_ops = tf.cond(require_init,_init,lambda : [self.g,self.b])

        with tf.control_dependencies(init_ops):

            w = tf.reshape(self.g,[1,1,tf.shape(self.v)[2],1]) * tf.nn.l2_normalize(self.v,axis=[0,1,3])
            return tf.nn.bias_add(
                tf.nn.conv2d_transpose(input_var,w,
                                       output_shape=shapes,
                                       strides=self.strides,
                                       padding='SAME',
                                       data_format='NHWC'),
                self.b,data_format='NHWC',name=name)

    def get_variables(self):
        #TODO: self.v should be l2-normalized or not? / currently not.
        return {'v':self.v,'b':self.b,'g':self.g}

