class_docstr: Probabilistic decoder for `p(x_t | z_t, f)`.
  
  The decoder generates a sequence of image frames `x_{1:T}` from
  dynamic and static latent variables `z_{1:T}` and `f`, respectively,
  for timesteps `1:T`.
class_docstr_tok: ["Probabilistic","decoder","for","`","p","(","x_t","|","z_t",",","f",")","`",".","The","decoder","generates","a","sequence","of","image","frames","`","x_","{","1",":","T","}","`","from","dynamic","and","static","latent","variables","`","z_","{","1",":","T","}","`","and","`","f","`",",","respectively",",","for","timesteps","`","1",":","T","`","."]
docstr: Runs the model to generate a distribution p(x_t | z_t, f).
  
  Args:
    inputs: A tuple of (z_{1:T}, f), where `z_{1:T}` is a tensor of
      shape [..., batch_size, timesteps, latent_size_dynamic], and `f`
      is of shape [..., batch_size, latent_size_static].
  
  Returns:
    A batched Independent distribution wrapping a set of Normal
    distributions over the pixels of x_t, where the Independent
    distribution has event shape [height, width, channels], batch
    shape [batch_size, timesteps], and sample shape [sample_shape,
    batch_size, timesteps, height, width, channels].
code: def call(self, inputs):
      """Runs the model to generate a distribution p(x_t | z_t, f).
  
      Args:
        inputs: A tuple of (z_{1:T}, f), where `z_{1:T}` is a tensor of
          shape [..., batch_size, timesteps, latent_size_dynamic], and `f`
          is of shape [..., batch_size, latent_size_static].
  
      Returns:
        A batched Independent distribution wrapping a set of Normal
        distributions over the pixels of x_t, where the Independent
        distribution has event shape [height, width, channels], batch
        shape [batch_size, timesteps], and sample shape [sample_shape,
        batch_size, timesteps, height, width, channels].
      """
      # We explicitly broadcast f to the same shape as z other than the final
      # dimension, because `tf1.concat` can't automatically do this.
      dynamic, static = inputs
      timesteps = tf1.shape(input=dynamic)[-2]
      static = static[..., tf1.newaxis, :] + tf1.zeros([timesteps, 1])
      latents = tf1.concat(
          [dynamic, static], axis=-1
      )  # (sample, N, T, latents)
      out = self.dense(latents)
      out = tf1.reshape(out, (-1, 1, 1, self.hidden_size))
      out = self.conv_transpose1(out)
      out = self.conv_transpose2(out)
      out = self.conv_transpose3(out)
      out = self.conv_transpose4(out)  # (sample*N*T, h, w, c)
      expanded_shape = tf1.concat(
          (tf1.shape(input=latents)[:-1], tf1.shape(input=out)[1:]),
          axis=0,
      )
      out = tf1.reshape(out, expanded_shape)  # (sample, N, T, h, w, c)
      return tfd.Independent(
          distribution=tfd.Normal(loc=out, scale=1.0),
          reinterpreted_batch_ndims=3,  # wrap (h, w, c)
          name="decoded_image",
      )
  
imports: from datetime import datetime
  import functools
  from absl import app
  from absl import flags
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  import tensorflow_probability
  from tensorflow_probability.examples import sprites_dataset
  from tensorflow_probability.python.internal import tf_keras
label_desc: Use image node_id 2 for calling the Decoder obj's underlying member method code with example usage: obj.call(inputs) and returns: tfd