code: def testGetRegularizationLoss(self):
      # Empty regularization collection should evaluate to 0.0.
      with self.cached_session():
          self.assertEqual(0.0, util.get_regularization_loss().eval())
  
      # Loss should sum.
      ops.add_to_collection(
          ops.GraphKeys.REGULARIZATION_LOSSES, constant_op.constant(2.0)
      )
      ops.add_to_collection(
          ops.GraphKeys.REGULARIZATION_LOSSES, constant_op.constant(3.0)
      )
      with self.cached_session():
          self.assertEqual(5.0, util.get_regularization_loss().eval())
  
      # Check scope capture mechanism.
      with ops.name_scope("scope1"):
          ops.add_to_collection(
              ops.GraphKeys.REGULARIZATION_LOSSES,
              constant_op.constant(-1.0),
          )
      with self.cached_session():
          self.assertEqual(
              -1.0, util.get_regularization_loss("scope1").eval()
          )
  
imports: from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops.losses import util
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the LossesUtilTest obj's underlying member method code with example usage: obj.testGetRegularizationLoss() without return types