class_docstr: Test for tfp.math.trapz.
class_docstr_tok: ["Test","for","tfp.math.trapz","."]
code: def test_multidim_with_x(self):
      y = tf.ones((4, 5), dtype=tf.float64)
      v0 = tf.cast(tf.linspace(0.0, 1.0, 4), tf.float64)
      v1 = tf.cast(tf.linspace(0.0, 4.2, 5), tf.float64)
      x0, x1 = tf.meshgrid(v0, v1, indexing="ij")
      integral_0 = self.evaluate(integration.trapz(y, x0, axis=0))
      integral_1 = self.evaluate(integration.trapz(y, x1, axis=1))
      self.assertTupleEqual(integral_0.shape, (5,))
      self.assertTupleEqual(integral_1.shape, (4,))
      self.assertAllClose(integral_0, np.ones((5,)) * 1.0)
      self.assertAllClose(integral_1, np.ones((4,)) * 4.2)
  
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 9 for calling the TrapzTest obj's underlying member method code with example usage: obj.test_multidim_with_x() without return types