class_docstr: Autoencoder-augmented Transformer.
class_docstr_tok: ["Autoencoder-augmented","Transformer","."]
docstr: Adds `tf.summary`s to all terms in the losses dictionary.
docstr_tok: ["Adds","`","tf.summary","`","s","to","all","terms","in","the","losses","dictionary","."]
code: def _summarize_losses(self, losses_dict):
      """Adds `tf.summary`s to all terms in the losses dictionary."""
      super(TransformerAE, self)._summarize_losses(losses_dict)
      (
          nats_per_dim,
          bits_per_dim,
      ) = latent_layers.compute_nats_and_bits_per_dim(
          data_dim=self._data_dim,
          latent_dim=self._latent_dim,
          average_reconstruction=losses_dict["training"],
          average_prior=losses_dict["latent_pred"],
      )
      tf.summary.scalar("loss/nats_per_dim", nats_per_dim)
      tf.summary.scalar("loss/bits_per_dim", bits_per_dim)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import math
  import os
  from six.moves import range
  from tensor2tensor.layers import common_attention
  from tensor2tensor.layers import common_image_attention
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import discretization
  from tensor2tensor.layers import latent_layers
  from tensor2tensor.layers import modalities
  from tensor2tensor.models import transformer
  from tensor2tensor.utils import beam_search
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import expert_utils
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 6 for calling the TransformerAE obj's underlying member method code with example usage: obj._summarize_losses(losses_dict) without return types