(self, z, y, is_training)
return output
Build the generator network for the given inputs.

    Args:
      z: `Tensor` of shape [batch_size, z_dim] with latent code.
      y: `Tensor` of shape [batch_size, num_classes] with one hot encoded
        labels.
      is_training: boolean, are we in train or eval model.

    Returns:
      A tensor of size [batch_size] + self._image_shape with values in [0, 1].
Build the generator network for the given inputs.
Build the generator network for the given inputs .
def apply(self, z, y, is_training):
    """Build the generator network for the given inputs.

    Args:
      z: `Tensor` of shape [batch_size, z_dim] with latent code.
      y: `Tensor` of shape [batch_size, num_classes] with one hot encoded
        labels.
      is_training: boolean, are we in train or eval model.

    Returns:
      A tensor of size [batch_size] + self._image_shape with values in [0, 1].
    """
    z_shape = z.get_shape().as_list()
    if len(z_shape) != 2:
      raise ValueError("Expected shape [batch_size, z_dim], got %s." % z_shape)
    ch = 64
    colors = self._image_shape[2]
    # Map noise to the actual seed.
    output = ops.linear(z, 4 * 4 * 8 * ch, scope="fc_noise")
    # Reshape the seed to be a rank-4 Tensor.
    output = tf.reshape(output, [-1, 4, 4, 8 * ch], name="fc_reshaped")
    in_channels = 8 * ch
    out_channels = 4 * ch
    for superblock in range(6):
      for i in range(5):
        block = self._resnet_block(
            name="B_{}_{}".format(superblock, i),
            in_channels=in_channels,
            out_channels=in_channels,
            scale="none")
        output = block(output, z=z, y=y, is_training=is_training)
      # We want to upscale 5 times.
      if superblock < 5:
        block = self._resnet_block(
            name="B_{}_up".format(superblock),
            in_channels=in_channels,
            out_channels=out_channels,
            scale="up")
        output = block(output, z=z, y=y, is_training=is_training)
      in_channels /= 2
      out_channels /= 2

    output = ops.conv2d(
        output, output_dim=colors, k_h=3, k_w=3, d_h=1, d_w=1,
        name="final_conv")
    output = tf.nn.sigmoid(output)
    return output
def apply ( self , z , y , is_training ) : z_shape = z . get_shape ( ) . as_list ( ) if len ( z_shape ) != 2 : raise ValueError ( "Expected shape [batch_size, z_dim], got %s." % z_shape ) ch = 64 colors = self . _image_shape [ 2 ] # Map noise to the actual seed. output = ops . linear ( z , 4 * 4 * 8 * ch , scope = "fc_noise" ) # Reshape the seed to be a rank-4 Tensor. output = tf . reshape ( output , [ - 1 , 4 , 4 , 8 * ch ] , name = "fc_reshaped" ) in_channels = 8 * ch out_channels = 4 * ch for superblock in range ( 6 ) : for i in range ( 5 ) : block = self . _resnet_block ( name = "B_{}_{}" . format ( superblock , i ) , in_channels = in_channels , out_channels = in_channels , scale = "none" ) output = block ( output , z = z , y = y , is_training = is_training ) # We want to upscale 5 times. if superblock < 5 : block = self . _resnet_block ( name = "B_{}_up" . format ( superblock ) , in_channels = in_channels , out_channels = out_channels , scale = "up" ) output = block ( output , z = z , y = y , is_training = is_training ) in_channels /= 2 out_channels /= 2 output = ops . conv2d ( output , output_dim = colors , k_h = 3 , k_w = 3 , d_h = 1 , d_w = 1 , name = "final_conv" ) output = tf . nn . sigmoid ( output ) return output