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_value_no_batch(self):
      """Tests PiecewiseConstantFunc with no batching."""
      for dtype in [np.float32, np.float64]:
          x = np.array([0.0, 0.1, 2.0, 11.0])
          jump_locations = np.array([0.1, 10], dtype=dtype)
          values = tf.constant([3, 4, 5], dtype=dtype)
          piecewise_func = piecewise.PiecewiseConstantFunc(
              jump_locations, values, dtype=dtype
          )
          # Also verifies left-continuity
          value = piecewise_func(x)
          self.assertEqual(value.dtype.as_numpy_dtype, dtype)
          expected_value = np.array([3.0, 3.0, 4.0, 5.0])
          self.assertAllEqual(value, expected_value)
  
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 5 for calling the Piecewise obj's underlying member method code with example usage: obj.test_piecewise_constant_value_no_batch() without return types