class_docstr: Base class to implement an encoder that creates a latent z vector.
  
  Users should override compute_z() to define the actual encoder structure.
  Input_keys from compute_z() instead of call(), output_keys are always ['z'].
docstr: Make sure z has same temporal resolution as other conditioning.
docstr_tok: ["Make","sure","z","has","same","temporal","resolution","as","other","conditioning","."]
code: def expand_z(self, z, time_steps):
      """Make sure z has same temporal resolution as other conditioning."""
      # Add time dim of z if necessary.
      if len(z.shape) == 2:
          z = z[:, tf.newaxis, :]
      # Expand time dim of z if necessary.
      z_time_steps = int(z.shape[1])
      if z_time_steps != time_steps:
          z = ddsp.core.resample(z, time_steps)
      return z
  
imports: import ddsp
  from ddsp import spectral_ops
  from ddsp.training import nn
  import gin
  import tensorflow.compat.v2
label_desc: Use image node_id 3 for calling the ZEncoder obj's underlying member method code with example usage: obj.expand_z(z, time_steps) and returns: z