def make_decoder(activation, latent_size, output_shape, base_depth):
deconv = functools.partial(<EOL>tf.keras.layers.Conv2DTranspose, padding="<STR_LIT>", activation=activation)<EOL>conv = functools.partial(<EOL>tf.keras.layers.Conv2D, padding="<STR_LIT>", activation=activation)<EOL>decoder_net = tf.keras.Sequential([<EOL>deconv(<NUM_LIT:2> * base_depth, <NUM_LIT:7>, padding="<STR_LIT>"),<EOL>deconv(<NUM_LIT:2> * base_depth, <NUM_LIT:5>),<EOL>deconv(<NUM_LIT:2> * base_depth, <NUM_LIT:5>, <NUM_LIT:2>),<EOL>deconv(base_depth, <NUM_LIT:5>),<EOL>deconv(base_depth, <NUM_LIT:5>, <NUM_LIT:2>),<EOL>deconv(base_depth, <NUM_LIT:5>),<EOL>conv(output_shape[-<NUM_LIT:1>], <NUM_LIT:5>, activation=None),<EOL>])<EOL>def decoder(codes):<EOL><INDENT>original_shape = tf.shape(input=codes)<EOL>codes = tf.reshape(codes, (-<NUM_LIT:1>, <NUM_LIT:1>, <NUM_LIT:1>, latent_size))<EOL>logits = decoder_net(codes)<EOL>logits = tf.reshape(<EOL>logits, shape=tf.concat([original_shape[:-<NUM_LIT:1>], output_shape], axis=<NUM_LIT:0>))<EOL>return tfd.Independent(tfd.Bernoulli(logits=logits),<EOL>reinterpreted_batch_ndims=len(output_shape),<EOL>name="<STR_LIT:image>")<EOL><DEDENT>return decoder<EOL>
Creates the decoder function.

    Args:
      activation: Activation function in hidden layers.
      latent_size: Dimensionality of the encoding.
      output_shape: The output image shape.
      base_depth: Smallest depth for a layer.

    Returns:
      decoder: A `callable` mapping a `Tensor` of encodings to a
        `tfd.Distribution` instance over images.