docstr: Test calculating the loss.
code: def test_calculate_losses(self):
      """Test calculating the loss."""
      pred, loss = keras_evaluation.calculate_losses(
          self.model, self.train_data, self.train_labels
      )
      self.assertEqual(pred.shape, (self.ntrain, self.nclass))
      self.assertEqual(loss.shape, (self.ntrain,))
  
      pred, loss = keras_evaluation.calculate_losses(
          self.model, self.test_data, self.test_labels
      )
      self.assertEqual(pred.shape, (self.ntest, self.nclass))
      self.assertEqual(loss.shape, (self.ntest,))
  
file_path: privacy/tensorflow_privacy/privacy/privacy_tests/membership_inference_attack/keras_evaluation_test.py
imports: from absl.testing import absltest
  import numpy
  import tensorflow
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack import keras_evaluation
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import AttackResults
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import AttackType
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import get_flattened_attack_metrics
label_desc: Use image node_id 2 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_calculate_losses() without return types