class_docstr: HiFiC Model class.
class_docstr_tok: ["HiFiC","Model","class","."]
docstr: Compute a forward pass through encoder and decoder.
  
  Args:
    input_image: Input image, range [0, 255]
    create_summaries: Whether to create summaries
  
  Returns:
    tuple Nodes, BppPair
docstr_tok: ["Compute","a","forward","pass","through","encoder","and","decoder",".","Args",":","input_image",":","Input","image",",","range","[","0",",","255","]","create_summaries",":","Whether","to","create","summaries","Returns",":","tuple","Nodes",",","BppPair"]
code: def _compute_compression_graph(
      self, input_image, create_summaries=True
  ):
      """Compute a forward pass through encoder and decoder.
  
      Args:
        input_image: Input image, range [0, 255]
        create_summaries: Whether to create summaries
  
      Returns:
        tuple Nodes, BppPair
      """
      with tf.name_scope("image_shape"):
          image_shape = tf.shape(input_image)[1:-1]  # Get H, W.
  
      if self.evaluation:
          num_downscaling = self._encoder.num_downsampling_layers
          factor = 2**num_downscaling
          tf.logging.info("Padding to {}".format(factor))
          input_image = _pad(input_image, image_shape, factor)
  
      with tf.name_scope("scale_down"):
          input_image_scaled = tf.cast(input_image, tf.float32) / 255.0
  
      info = self._get_encoder_out(input_image_scaled, image_shape)
      decoder_in = info.decoded
      total_nbpp = info.total_nbpp
      total_qbpp = info.total_qbpp
      bitstream_tensors = info.bitstream_tensors
  
      (
          reconstruction,
          reconstruction_scaled,
      ) = self._compute_reconstruction(
          decoder_in, image_shape, input_image_scaled.shape
      )
  
      if create_summaries and self._create_image_summaries:
          tf.summary.image(
              "input_image",
              tf.saturate_cast(input_image, tf.uint8),
              max_outputs=1,
          )
          tf.summary.image(
              "reconstruction",
              tf.saturate_cast(reconstruction, tf.uint8),
              max_outputs=1,
          )
  
      nodes = Nodes(
          input_image,
          input_image_scaled,
          reconstruction,
          reconstruction_scaled,
          latent_quantized=decoder_in,
      )
      return nodes, BppPair(total_nbpp, total_qbpp), bitstream_tensors
  
imports: import collections
  import glob
  import itertools
  from compare_gan.gans import loss_lib
  import tensorflow.compat.v1
  import tensorflow_datasets
  from hific import archs
  from hific import helpers
  from hific.helpers import ModelMode
  from hific.helpers import ModelType
  from hific.helpers import TFDSArguments
label_desc: Use image node_id 18 for calling the HiFiC obj's underlying member method code with example usage: obj._compute_compression_graph(input_image, create_summaries) and returns: nodes,  BppPair,  bitstream_tensors