class_docstr: Test calculate_statistic.
class_docstr_tok: ["Test","calculate_statistic","."]
docstr: Test calculate_statistic with input as logit.
docstr_tok: ["Test","calculate_statistic","with","input","as","logit","."]
code: def test_calculate_statistic_logit(self):
      """Test calculate_statistic with input as logit."""
      is_logits = True
      logit = np.array([[1, 2, -3.0], [-1, 1, 0]])
      # expected probability vector
      # array([[0.26762315, 0.72747516, 0.00490169],
      #        [0.09003057, 0.66524096, 0.24472847]])
      labels = np.array([1, 2])
  
      stat = amia.calculate_statistic(
          logit, labels, None, is_logits, "conf with prob"
      )
      np.testing.assert_allclose(
          stat, np.array([0.72747516, 0.24472847])
      )
  
      stat = amia.calculate_statistic(
          logit, labels, None, is_logits, "xe"
      )
      np.testing.assert_allclose(
          stat, np.array([0.31817543, 1.40760596])
      )
  
      stat = amia.calculate_statistic(
          logit, labels, None, is_logits, "logit"
      )
      np.testing.assert_allclose(
          stat, np.array([0.98185009, -1.12692802])
      )
  
      stat = amia.calculate_statistic(
          logit, labels, None, is_logits, "conf with logit"
      )
      np.testing.assert_allclose(stat, np.array([2, 0.0]))
  
      stat = amia.calculate_statistic(
          logit, labels, None, is_logits, "hinge"
      )
      np.testing.assert_allclose(stat, np.array([1, -1.0]))
  
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack import advanced_mia
label_desc: Use image node_id 1 for calling the TestCalculateStatistic obj's underlying member method code with example usage: obj.test_calculate_statistic_logit() without return types