(self, z, y, is_training)
return net
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].
    """
    gf_dim = 64  # Dimension of filters in first convolutional layer.
    bs = z.shape[0].value
    s_h, s_w, colors = self._image_shape
    s_h2, s_w2 = conv_out_size_same(s_h, 2), conv_out_size_same(s_w, 2)
    s_h4, s_w4 = conv_out_size_same(s_h2, 2), conv_out_size_same(s_w2, 2)
    s_h8, s_w8 = conv_out_size_same(s_h4, 2), conv_out_size_same(s_w4, 2)
    s_h16, s_w16 = conv_out_size_same(s_h8, 2), conv_out_size_same(s_w8, 2)

    net = linear(z, gf_dim * 8 *s_h16 * s_w16, scope="g_fc1")
    net = tf.reshape(net, [-1, s_h16, s_w16, gf_dim * 8])
    net = self.batch_norm(net, z=z, y=y, is_training=is_training, name="g_bn1")
    net = tf.nn.relu(net)
    net = deconv2d(net, [bs, s_h8, s_w8, gf_dim*4], 5, 5, 2, 2, name="g_dc1")
    net = self.batch_norm(net, z=z, y=y, is_training=is_training, name="g_bn2")
    net = tf.nn.relu(net)
    net = deconv2d(net, [bs, s_h4, s_w4, gf_dim*2], 5, 5, 2, 2, name="g_dc2")
    net = self.batch_norm(net, z=z, y=y, is_training=is_training, name="g_bn3")
    net = tf.nn.relu(net)
    net = deconv2d(net, [bs, s_h2, s_w2, gf_dim*1], 5, 5, 2, 2, name="g_dc3")
    net = self.batch_norm(net, z=z, y=y, is_training=is_training, name="g_bn4")
    net = tf.nn.relu(net)
    net = deconv2d(net, [bs, s_h, s_w, colors], 5, 5, 2, 2, name="g_dc4")
    net = 0.5 * tf.nn.tanh(net) + 0.5
    return net
def apply ( self , z , y , is_training ) : gf_dim = 64 # Dimension of filters in first convolutional layer. bs = z . shape [ 0 ] . value s_h , s_w , colors = self . _image_shape s_h2 , s_w2 = conv_out_size_same ( s_h , 2 ) , conv_out_size_same ( s_w , 2 ) s_h4 , s_w4 = conv_out_size_same ( s_h2 , 2 ) , conv_out_size_same ( s_w2 , 2 ) s_h8 , s_w8 = conv_out_size_same ( s_h4 , 2 ) , conv_out_size_same ( s_w4 , 2 ) s_h16 , s_w16 = conv_out_size_same ( s_h8 , 2 ) , conv_out_size_same ( s_w8 , 2 ) net = linear ( z , gf_dim * 8 * s_h16 * s_w16 , scope = "g_fc1" ) net = tf . reshape ( net , [ - 1 , s_h16 , s_w16 , gf_dim * 8 ] ) net = self . batch_norm ( net , z = z , y = y , is_training = is_training , name = "g_bn1" ) net = tf . nn . relu ( net ) net = deconv2d ( net , [ bs , s_h8 , s_w8 , gf_dim * 4 ] , 5 , 5 , 2 , 2 , name = "g_dc1" ) net = self . batch_norm ( net , z = z , y = y , is_training = is_training , name = "g_bn2" ) net = tf . nn . relu ( net ) net = deconv2d ( net , [ bs , s_h4 , s_w4 , gf_dim * 2 ] , 5 , 5 , 2 , 2 , name = "g_dc2" ) net = self . batch_norm ( net , z = z , y = y , is_training = is_training , name = "g_bn3" ) net = tf . nn . relu ( net ) net = deconv2d ( net , [ bs , s_h2 , s_w2 , gf_dim * 1 ] , 5 , 5 , 2 , 2 , name = "g_dc3" ) net = self . batch_norm ( net , z = z , y = y , is_training = is_training , name = "g_bn4" ) net = tf . nn . relu ( net ) net = deconv2d ( net , [ bs , s_h , s_w , colors ] , 5 , 5 , 2 , 2 , name = "g_dc4" ) net = 0.5 * tf . nn . tanh ( net ) + 0.5 return net