code: def test_adaptation_target_zero_geometric(self):
      record1 = tf.constant([5.0])
      record2 = tf.constant([-2.5])
  
      query = (
          quantile_adaptive_clip_sum_query.QuantileAdaptiveClipSumQuery(
              initial_l2_norm_clip=16.0,
              noise_multiplier=0.0,
              target_unclipped_quantile=0.0,
              learning_rate=np.log(
                  2.0
              ),  # Geometric steps in powers of 2.
              clipped_count_stddev=0.0,
              expected_num_records=2.0,
              geometric_update=True,
          )
      )
  
      global_state = query.initial_global_state()
  
      initial_clip = global_state.sum_state.l2_norm_clip
      self.assertAllClose(initial_clip, 16.0)
  
      # For two iterations, nothing is clipped, so the clip is cut in half.
      # Then one record is clipped, so the clip goes down by only sqrt(2.0) to
      # 4 / sqrt(2.0). Still only one record is clipped, so it reduces to 2.0.
      # Now both records are clipped, and the clip norm stays there (at 2.0).
  
      four_div_root_two = 4 / np.sqrt(2.0)  # approx 2.828
  
      expected_sums = [2.5, 2.5, 1.5, four_div_root_two - 2.5, 0.0]
      expected_clips = [8.0, 4.0, four_div_root_two, 2.0, 2.0]
      for expected_sum, expected_clip in zip(
          expected_sums, expected_clips
      ):
          actual_sum, global_state = test_utils.run_query(
              query, [record1, record2], global_state
          )
  
          actual_clip = global_state.sum_state.l2_norm_clip
  
          self.assertAllClose(actual_clip.numpy(), expected_clip)
          self.assertAllClose(actual_sum.numpy(), (expected_sum,))
  
file_path: privacy/tensorflow_privacy/privacy/dp_query/quantile_adaptive_clip_sum_query_test.py
imports: from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_privacy.privacy.dp_query import quantile_adaptive_clip_sum_query
  from tensorflow_privacy.privacy.dp_query import test_utils
label_desc: Use image node_id 5 for calling the QuantileAdaptiveClipSumQueryTest obj's underlying member method code with example usage: obj.test_adaptation_target_zero_geometric() without return types