def test_temperature_scaling_incorrect_value_error(self):
    calibration_config = calibration_pb2.CalibrationConfig()
    calibration_config.temperature_scaling_calibration.scaler = 0
    calibration_fn = calibration_builder.build(calibration_config)
    class_predictions_with_background = tf.constant([[[0.1, 0.2, 0.3]]], dtype=tf.float32)
    with self.assertRaises(ValueError):
        calibration_fn(class_predictions_with_background)
def test_temperature_scaling_incorrect_value_error(self):
    calibration_config = calibration_pb2.CalibrationConfig()
    calibration_config.temperature_scaling_calibration.scaler = 0
    calibration_fn = calibration_builder.build(calibration_config)
    class_predictions_with_background = tf.constant([[[0.1, 0.2, 0.3]]], dtype=tf.float32)
    with self.assertRaises(ValueError):
        calibration_fn(class_predictions_with_background)