class_docstr: Test for tfp.math.trapz.
class_docstr_tok: ["Test","for","tfp.math.trapz","."]
code: def test_multidim_with_nonhomogeneous_x(self):
      # integration domain from x is different for each batch dim
      y = tf.ones((3, 4), dtype=tf.float32)
      x = tf.constant(
          [[0, 1, 2, 3], [0, 2, 4, 6], [0, 3, 6, 9]], dtype=tf.float32
      )
      integral = self.evaluate(integration.trapz(y, x, axis=-1))
      self.assertTupleEqual(integral.shape, (3,))
      np.testing.assert_almost_equal(integral, [3, 6, 9])
  
imports: import hypothesis
  from hypothesis import strategies
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import hypothesis_testlib
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import integration
label_desc: Use image node_id 10 for calling the TrapzTest obj's underlying member method code with example usage: obj.test_multidim_with_nonhomogeneous_x() without return types