gan_cifar_resnet.py
def Normalize(name, inputs, labels=None):
        """This is messy, but basically it chooses between batchnorm, layernorm,
        their conditional variants, or nothing, depending on the value of `name` and
        the global hyperparam flags."""
        if not CONDITIONAL:
            labels = None
        if CONDITIONAL and ACGAN and ('Discriminator' in name):
            labels = None

        if ('Discriminator' in name) and NORMALIZATION_D:
            assert(False)
            return lib.ops.layernorm.Layernorm(name,[1,2,3],inputs,labels=labels,n_labels=10)
        elif ('Generator' in name) and NORMALIZATION_G:
            if labels is not None:
                assert(False)
                return lib.ops.cond_batchnorm.Batchnorm(name,[0,2,3],inputs,labels=labels,n_labels=10)
            else:
                return lib.ops.batchnorm.Batchnorm(name,[0,2,3],inputs,fused=True)
        else:
            return inputs
This is messy, but basically it chooses between batchnorm, layernorm,
        their conditional variants, or nothing, depending on the value of `name` and
        the global hyperparam flags.
This is messy, but basically it chooses between batchnorm, layernorm,
their conditional variants, or nothing, depending on the value of `name` and
the global hyperparam flags.
This is messy but basically it chooses between batchnorm layernorm their conditional variants or nothing depending on the value of ` name ` and the global hyperparam flags .
def Normalize(name, inputs, labels=None):
        if not CONDITIONAL:
            labels = None
        if CONDITIONAL and ACGAN and ('Discriminator' in name):
            labels = None
        if ('Discriminator' in name) and NORMALIZATION_D:
            assert(False)
            return lib.ops.layernorm.Layernorm(name,[1,2,3],inputs,labels=labels,n_labels=10)
        elif ('Generator' in name) and NORMALIZATION_G:
            if labels is not None:
                assert(False)
                return lib.ops.cond_batchnorm.Batchnorm(name,[0,2,3],inputs,labels=labels,n_labels=10)
            else:
                return lib.ops.batchnorm.Batchnorm(name,[0,2,3],inputs,fused=True)
        else:
            return inputs
def Normalize ( name , inputs , labels = None ) : if not CONDITIONAL : labels = None if CONDITIONAL and ACGAN and ( 'Discriminator' in name ) : labels = None if ( 'Discriminator' in name ) and NORMALIZATION_D : assert ( False ) return lib . ops . layernorm . Layernorm ( name , [ 1 , 2 , 3 ] , inputs , labels = labels , n_labels = 10 ) elif ( 'Generator' in name ) and NORMALIZATION_G : if labels is not None : assert ( False ) return lib . ops . cond_batchnorm . Batchnorm ( name , [ 0 , 2 , 3 ] , inputs , labels = labels , n_labels = 10 ) else : return lib . ops . batchnorm . Batchnorm ( name , [ 0 , 2 , 3 ] , inputs , fused = True ) else : return inputs
This is messy, but basically it chooses between batchnorm, layernorm,
their conditional variants, or nothing, depending on the value of `name` and
the global hyperparam flags.
This is messy but basically it chooses between batchnorm layernorm their conditional variants or nothing depending on the value of ` name ` and the global hyperparam flags .
"""This is messy, but basically it chooses between batchnorm, layernorm,
        their conditional variants, or nothing, depending on the value of `name` and
        the global hyperparam flags."""
name
inputs
labels