class_docstr: Tests all time-step dependent Schedule classes.
code: def test_piecewise_schedule(self):
      ts = [0, 5, 10, 100, 90, 2, 1, 99, 27]
      expected = [50.0, 60.0, 70.0, 14.5, 14.5, 54.0, 52.0, 14.5, 140.0]
      config = dict(
          endpoints=[(0, 50.0), (25, 100.0), (30, 200.0)],
          outside_value=14.5,
      )
  
      for fw in framework_iterator(
          frameworks=["tf2", "tf", "torch", None]
      ):
          piecewise = from_config(
              PiecewiseSchedule, config, framework=fw
          )
          for t, e in zip(ts, expected):
              out = piecewise(t)
              check(out, e, decimals=4)
  
          ts_as_tensors = self._get_framework_tensors(ts, fw)
          for t, e in zip(ts_as_tensors, expected):
              out = piecewise(t)
              assert fw != "tf" or isinstance(out, tf.Tensor)
              check(out, e, decimals=4)
  
file_path: ray/python/ray/rllib/utils/schedules/tests/test_schedules.py
imports: import unittest
  from ray.rllib.utils.schedules import ConstantSchedule, LinearSchedule, ExponentialSchedule, PiecewiseSchedule
  from ray.rllib.utils import check, framework_iterator, try_import_tf, try_import_torch
  from ray.rllib.utils.from_config import from_config
label_desc: Use image node_id 5 for calling the TestSchedules obj's underlying member method code with example usage: obj.test_piecewise_schedule() without return types