class_docstr: Test for tfp.math.trapz.
class_docstr_tok: ["Test","for","tfp.math.trapz","."]
code: def test_multidim_broadcast_1d_x(self):
      # To use trapz() with a 1d x array, first broadcast it with the shape of y
      y = tf.ones((4, 5), dtype=tf.float64)
      x1 = tf.cast(tf.linspace(0.0, 4.2, 5), tf.float64)
      x = x1 * tf.ones((4, 5), dtype=tf.float64)
      integral = self.evaluate(integration.trapz(y, x, axis=1))
      self.assertTupleEqual(integral.shape, (4,))
      self.assertAllClose(integral, 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 11 for calling the TrapzTest obj's underlying member method code with example usage: obj.test_multidim_broadcast_1d_x() without return types