class_docstr: Tests for methods in piecewise module.
class_docstr_tok: ["Tests","for","methods","in","piecewise","module","."]
docstr: Tests PiecewiseConstantFunc with no batching.
docstr_tok: ["Tests","PiecewiseConstantFunc","with","no","batching","."]
code: def test_piecewise_constant_integral_no_batch(self):
      """Tests PiecewiseConstantFunc with no batching."""
      for dtype in [np.float32, np.float64]:
          x = np.array([-4.1, 0.0, 1.0, 1.5, 2.0, 4.5, 5.5])
          jump_locations = np.array([1, 2, 3, 4, 5], dtype=dtype)
          values = np.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6])
          piecewise_func = piecewise.PiecewiseConstantFunc(
              jump_locations, values, dtype=dtype
          )
          value = piecewise_func.integrate(x, x + 4.1)
          self.assertEqual(value.dtype.as_numpy_dtype, dtype)
          expected_value = np.array(
              [0.41, 1.05, 1.46, 1.66, 1.86, 2.41, 2.46]
          )
          self.assertAllClose(
              value, expected_value, atol=1e-5, rtol=1e-5
          )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 6 for calling the Piecewise obj's underlying member method code with example usage: obj.test_piecewise_constant_integral_no_batch() without return types