class_docstr: An interface to a trained model for encoding, decoding, and sampling.
  
  Attributes:
    config: The Config to build the model graph with.
    batch_size: The batch size to build the model graph with.
    checkpoint_dir_or_path: The directory containing checkpoints for the model,
      the most recent of which will be loaded, or a direct path to a specific
      checkpoint.
    var_name_substitutions: Optional list of string pairs containing regex
      patterns and substitution values for renaming model variables to match
      those in the checkpoint. Useful for backwards compatibility.
    session_target: Optional execution engine to connect to. Defaults to
      in-process.
    sample_kwargs: Additional, non-tensor keyword arguments to pass to sample
      call.
class_docstr_tok: ["An","interface","to","a","trained","model","for","encoding",",","decoding",",","and","sampling",".","Attributes",":","config",":","The","Config","to","build","the","model","graph","with",".","batch_size",":","The","batch","size","to","build","the","model","graph","with",".","checkpoint_dir_or_path",":","The","directory","containing","checkpoints","for","the","model",",","the","most","recent","of","which","will","be","loaded",",","or","a","direct","path","to","a","specific","checkpoint",".","var_name_substitutions",":","Optional","list","of","string","pairs","containing","regex","patterns","and","substitution","values","for","renaming","model","variables","to","match","those","in","the","checkpoint",".","Useful","for","backwards","compatibility",".","session_target",":","Optional","execution","engine","to","connect","to",".","Defaults","to","in-process",".","sample_kwargs",":","Additional",",","non-tensor","keyword","arguments","to","pass","to","sample","call","."]
docstr: 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.
docstr_tok: ["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","."]
code: 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]
  
imports: import copy
  import os
  import re
  import tarfile
  import tempfile
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 6 for calling the TrainedModel obj's underlying member method code with example usage: obj.decode_to_tensors(z, length, temperature, c_input, return_full_results) and returns: outputs