code: def test_gradient(self, input_shape, amplitudes):
      length_scale = tf.Variable(
          tf.random.stateless_uniform(
              [input_shape[-1]],
              seed=test_util.test_seed(sampler_type="stateless"),
              minval=0.0,
              maxval=2.0,
              dtype=tf.float32,
          )
      )
      inner_kernel = exponentiated_quadratic.ExponentiatedQuadratic(
          amplitude=1.0, length_scale=length_scale
      )
      kernel = additive_kernel.AdditiveKernel(
          kernel=inner_kernel, amplitudes=amplitudes
      )
  
      x = tf.random.stateless_uniform(
          input_shape,
          seed=test_util.test_seed(sampler_type="stateless"),
          minval=-2.0,
          maxval=2.0,
          dtype=tf.float32,
      )
      y = tf.random.stateless_uniform(
          input_shape,
          seed=test_util.test_seed(sampler_type="stateless"),
          minval=-2.0,
          maxval=2.0,
          dtype=tf.float32,
      )
  
      with tf.GradientTape() as tape:
          tape.watch(x)
          k = kernel.apply(x, y)
      self.evaluate([v.initializer for v in kernel.trainable_variables])
      grads = tape.gradient(k, kernel.trainable_variables + (x,))
      self.assertAllNotNone(grads)
      self.assertLen(grads, 2)
  
file_path: probability/tensorflow_probability/python/experimental/psd_kernels/additive_kernel_test.py
imports: import itertools
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.psd_kernels import additive_kernel
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math.psd_kernels import exponentiated_quadratic
label_desc: Use image node_id 5 for calling the AdditiveKernelTest obj's underlying member method code with example usage: obj.test_gradient(input_shape, amplitudes) without return types