(self, inputs, z, y, is_training)
ResNet block containing possible down/up sampling, shared for G / D.

    Args:
      inputs: a 3d input tensor of feature map.
      z: the latent vector for potential self-modulation. Can be None if use_sbn
        is set to False.
      y: `Tensor` of shape [batch_size, num_classes] with one hot encoded
        labels.
      is_training: boolean, whether or notthis is called during the training.

    Returns:
      output: a 3d output tensor of feature map.
ResNet block containing possible down/up sampling, shared for G / D.
ResNet block containing possible down / up sampling shared for G / D .
def apply(self, inputs, z, y, is_training):
    """"ResNet block containing possible down/up sampling, shared for G / D.

    Args:
      inputs: a 3d input tensor of feature map.
      z: the latent vector for potential self-modulation. Can be None if use_sbn
        is set to False.
      y: `Tensor` of shape [batch_size, num_classes] with one hot encoded
        labels.
      is_training: boolean, whether or notthis is called during the training.

    Returns:
      output: a 3d output tensor of feature map.
    """
    if inputs.get_shape().as_list()[-1] != self._in_channels:
      raise ValueError("Unexpected number of input channels.")

    with tf.variable_scope(self._name, values=[inputs]):
      output = inputs

      shortcut = self._get_conv(
          output, self._in_channels, self._out_channels, self._scale,
          suffix="conv_shortcut")

      output = self.batch_norm(
          output, z=z, y=y, is_training=is_training, name="bn1")
      if self._layer_norm:
        output = ops.layer_norm(output, is_training=is_training, scope="ln1")

      output = tf.nn.relu(output)
      output = self._get_conv(
          output, self._in_channels, self._out_channels, self._scale1,
          suffix="conv1")

      output = self.batch_norm(
          output, z=z, y=y, is_training=is_training, name="bn2")
      if self._layer_norm:
        output = ops.layer_norm(output, is_training=is_training, scope="ln2")

      output = tf.nn.relu(output)
      output = self._get_conv(
          output, self._out_channels, self._out_channels, self._scale2,
          suffix="conv2")

      # Combine skip-connection with the convolved part.
      output += shortcut
      return output
def apply ( self , inputs , z , y , is_training ) : if inputs . get_shape ( ) . as_list ( ) [ - 1 ] != self . _in_channels : raise ValueError ( "Unexpected number of input channels." ) with tf . variable_scope ( self . _name , values = [ inputs ] ) : output = inputs shortcut = self . _get_conv ( output , self . _in_channels , self . _out_channels , self . _scale , suffix = "conv_shortcut" ) output = self . batch_norm ( output , z = z , y = y , is_training = is_training , name = "bn1" ) if self . _layer_norm : output = ops . layer_norm ( output , is_training = is_training , scope = "ln1" ) output = tf . nn . relu ( output ) output = self . _get_conv ( output , self . _in_channels , self . _out_channels , self . _scale1 , suffix = "conv1" ) output = self . batch_norm ( output , z = z , y = y , is_training = is_training , name = "bn2" ) if self . _layer_norm : output = ops . layer_norm ( output , is_training = is_training , scope = "ln2" ) output = tf . nn . relu ( output ) output = self . _get_conv ( output , self . _out_channels , self . _out_channels , self . _scale2 , suffix = "conv2" ) # Combine skip-connection with the convolved part. output += shortcut return output