code: def test_adaptation_target_one_geometric(self):
      record1 = tf.constant([-1.5])
      record2 = tf.constant([3.0])
  
      query = (
          quantile_adaptive_clip_sum_query.QuantileAdaptiveClipSumQuery(
              initial_l2_norm_clip=0.5,
              noise_multiplier=0.0,
              target_unclipped_quantile=1.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, 0.5)
  
      # On the first two iterations, both are clipped, so the clip is doubled.
      # When the clip reaches 2.0, only one record is clipped, so the clip is
      # multiplied by sqrt(2.0). Still only one is clipped so it increases to 4.0.
      # Now both records are clipped, and the clip norm stays there (at 4.0).
  
      two_times_root_two = 2 * np.sqrt(2.0)  # approx 2.828
  
      expected_sums = [0.0, 0.0, 0.5, two_times_root_two - 1.5, 1.5]
      expected_clips = [1.0, 2.0, two_times_root_two, 4.0, 4.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 7 for calling the QuantileAdaptiveClipSumQueryTest obj's underlying member method code with example usage: obj.test_adaptation_target_one_geometric() without return types