code: def test_expected_calibration_error(self):
      probs = tf.convert_to_tensor([[0.3, 0.7], [0.9, 0.1], [0.4, 0.6]])
      logits = tf.math.log(probs)
      labels = tf.convert_to_tensor([1, 0, 0], dtype=tf.int32)
  
      ece = self.evaluate(
          calibration.expected_calibration_error(
              3, logits=logits, labels_true=labels
          )
      )
  
      self.assertAlmostEqual(
          0.33333333,
          ece,
          places=6,
          msg="Computed ECE (%.5f) does not match "
          "true ECE (1/3)." % (ece,),
      )
  
imports: import itertools
  from absl import logging
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.stats import calibration
label_desc: Use image node_id 6 for calling the CalibrationTest obj's underlying member method code with example usage: obj.test_expected_calibration_error() without return types