(self, z, length=None, temperature=1.0, c_input=None,
                        return_full_results=False)
return outputs[:n]
Decodes a collection of latent vectors into output tensors.

    Args:
      z: A collection of latent vectors to decode.
      length: The maximum length of a sample in decoder iterations. Required
        if end tokens are not being used.
      temperature: The softmax temperature to use (if applicable).
      c_input: Control sequence (if applicable).
      return_full_results: If true will return the full decoder_results,
        otherwise it will return only the samples.
    Returns:
      If return_full_results is True, will return the full decoder_results list,
      otherwise it will return the samples from the decoder as a 2D numpy array.
    Raises:
      RuntimeError: If called for a non-conditional model.
      ValueError: If `length` is not specified and an end token is not being
        used.
Decodes a collection of latent vectors into output tensors.
Decodes a collection of latent vectors into output tensors .
def decode_to_tensors(self, z, length=None, temperature=1.0, c_input=None,
                        return_full_results=False):
    """Decodes a collection of latent vectors into output tensors.

    Args:
      z: A collection of latent vectors to decode.
      length: The maximum length of a sample in decoder iterations. Required
        if end tokens are not being used.
      temperature: The softmax temperature to use (if applicable).
      c_input: Control sequence (if applicable).
      return_full_results: If true will return the full decoder_results,
        otherwise it will return only the samples.
    Returns:
      If return_full_results is True, will return the full decoder_results list,
      otherwise it will return the samples from the decoder as a 2D numpy array.
    Raises:
      RuntimeError: If called for a non-conditional model.
      ValueError: If `length` is not specified and an end token is not being
        used.
    """
    if not self._config.hparams.z_size:
      raise RuntimeError('Cannot decode with a non-conditional model.')

    if not length and self._config.data_converter.end_token is None:
      raise ValueError(
          'A length must be specified when the end token is not used.')
    batch_size = self._config.hparams.batch_size
    n = len(z)
    length = length or tf.int32.max

    batch_pad_amt = -n % batch_size
    z = np.pad(z, [(0, batch_pad_amt), (0, 0)], mode='constant')

    outputs = []
    for i in range(len(z) // batch_size):
      feed_dict = {
          self._temperature: temperature,
          self._z_input: z[i*batch_size:(i+1)*batch_size],
          self._max_length: length,
      }
      if self._c_input is not None:
        feed_dict[self._c_input] = c_input
      if return_full_results:
        outputs.extend(self._sess.run(self._decoder_results, feed_dict))
      else:
        outputs.extend(self._sess.run(self._outputs, feed_dict))
    return outputs[:n]
def decode_to_tensors ( self , z , length = None , temperature = 1.0 , c_input = None , return_full_results = False ) : if not self . _config . hparams . z_size : raise RuntimeError ( 'Cannot decode with a non-conditional model.' ) if not length and self . _config . data_converter . end_token is None : raise ValueError ( 'A length must be specified when the end token is not used.' ) batch_size = self . _config . hparams . batch_size n = len ( z ) length = length or tf . int32 . max batch_pad_amt = - n % batch_size z = np . pad ( z , [ ( 0 , batch_pad_amt ) , ( 0 , 0 ) ] , mode = 'constant' ) outputs = [ ] for i in range ( len ( z ) // batch_size ) : feed_dict = { self . _temperature : temperature , self . _z_input : z [ i * batch_size : ( i + 1 ) * batch_size ] , self . _max_length : length , } if self . _c_input is not None : feed_dict [ self . _c_input ] = c_input if return_full_results : outputs . extend ( self . _sess . run ( self . _decoder_results , feed_dict ) ) else : outputs . extend ( self . _sess . run ( self . _outputs , feed_dict ) ) return outputs [ : n ]