(self,
               name,
               in_channels,
               out_channels,
               scale,
               is_gen_block,
               layer_norm=False,
               spectral_norm=False,
               batch_norm=None)
Constructs a new ResNet block.

    Args:
      name: Scope name for the resent block.
      in_channels: Integer, the input channel size.
      out_channels: Integer, the output channel size.
      scale: Whether or not to scale up or down, choose from "up", "down" or
        "none".
      is_gen_block: Boolean, deciding whether this is a generator or
        discriminator block.
      layer_norm: Apply layer norm before both convolutions.
      spectral_norm: Use spectral normalization for all weights.
      batch_norm: Function for batch normalization.
Constructs a new ResNet block.
Constructs a new ResNet block .
def __init__(self,
               name,
               in_channels,
               out_channels,
               scale,
               is_gen_block,
               layer_norm=False,
               spectral_norm=False,
               batch_norm=None):
    """Constructs a new ResNet block.

    Args:
      name: Scope name for the resent block.
      in_channels: Integer, the input channel size.
      out_channels: Integer, the output channel size.
      scale: Whether or not to scale up or down, choose from "up", "down" or
        "none".
      is_gen_block: Boolean, deciding whether this is a generator or
        discriminator block.
      layer_norm: Apply layer norm before both convolutions.
      spectral_norm: Use spectral normalization for all weights.
      batch_norm: Function for batch normalization.
    """
    assert scale in ["up", "down", "none"]
    self._name = name
    self._in_channels = in_channels
    self._out_channels = out_channels
    self._scale = scale
    # In SN paper, if they upscale in generator they do this in the first conv.
    # For discriminator downsampling happens after second conv.
    self._scale1 = scale if is_gen_block else "none"
    self._scale2 = "none" if is_gen_block else scale
    self._layer_norm = layer_norm
    self._spectral_norm = spectral_norm
    self.batch_norm = batch_norm
def __init__ ( self , name , in_channels , out_channels , scale , is_gen_block , layer_norm = False , spectral_norm = False , batch_norm = None ) : assert scale in [ "up" , "down" , "none" ] self . _name = name self . _in_channels = in_channels self . _out_channels = out_channels self . _scale = scale # In SN paper, if they upscale in generator they do this in the first conv. # For discriminator downsampling happens after second conv. self . _scale1 = scale if is_gen_block else "none" self . _scale2 = "none" if is_gen_block else scale self . _layer_norm = layer_norm self . _spectral_norm = spectral_norm self . batch_norm = batch_norm