code: def testSummarizeLosses(self):
      with tf.Graph().as_default():
          model = t2t_model.T2TModel(hparam.HParams())
          losses = {
              "training": tf.random_normal([]),
              "extra": tf.random_normal([]),
          }
          outputs = model._summarize_losses(losses)
          self.assertIsNone(outputs, None)
          self.assertEqual(
              len(
                  tf.get_collection(
                      tf.GraphKeys.SUMMARIES, scope="losses"
                  )
              ),
              len(losses),
          )
  
file_path: tensor2tensor/tensor2tensor/utils/t2t_model_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.data_generators import problem_hparams
  from tensor2tensor.utils import hparam
  from tensor2tensor.utils import t2t_model
  from tensor2tensor.utils import test_utils
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling the T2TModelTest obj's underlying member method code with example usage: obj.testSummarizeLosses() without return types