class_docstr: Piecewise-constant hyperparameter (specification key: `piecewise_constant`).
  
  Args:
      unit ("timesteps" | "episodes" | "updates"): Unit of interval boundaries
          (<span style="color:#C00000"><b>required</b></span>).
      boundaries (iter[long]): Strictly increasing interval boundaries for constant segments
          (<span style="color:#C00000"><b>required</b></span>).
      values (iter[dtype-dependent]): Interval values of constant segments, one more than
          (<span style="color:#C00000"><b>required</b></span>).
      name (string): <span style="color:#0000C0"><b>internal use</b></span>.
      dtype (type): <span style="color:#0000C0"><b>internal use</b></span>.
      min_value (dtype-compatible value): <span style="color:#0000C0"><b>internal use</b></span>.
      max_value (dtype-compatible value): <span style="color:#0000C0"><b>internal use</b></span>.
class_docstr_tok: ["Piecewise-constant","hyperparameter","(","specification","key",":","`","piecewise_constant","`",")",".","Args",":","unit","(","``","timesteps","''","|","``","episodes","''","|","``","updates","''",")",":","Unit","of","interval","boundaries","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",")",".","boundaries","(","iter","[","long","]",")",":","Strictly","increasing","interval","boundaries","for","constant","segments","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",")",".","values","(","iter","[","dtype-dependent","]",")",":","Interval","values","of","constant","segments",",","one","more","than","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",")",".","name","(","string",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">",".","dtype","(","type",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">",".","min_value","(","dtype-compatible","value",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">",".","max_value","(","dtype-compatible","value",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">","."]
code: def __init__(
      self,
      *,
      unit,
      boundaries,
      values,
      name=None,
      dtype=None,
      min_value=None,
      max_value=None,
  ):
      if isinstance(values[0], bool):
          if dtype != "bool":
              raise TensorforceError.unexpected()
      elif isinstance(values[0], int):
          if dtype != "int":
              raise TensorforceError.unexpected()
      elif isinstance(values[0], float):
          if dtype != "float":
              raise TensorforceError.unexpected()
      else:
          raise TensorforceError.unexpected()
  
      assert unit in ("timesteps", "episodes", "updates")
      assert len(values) == len(boundaries) + 1
      assert boundaries == sorted(boundaries) and boundaries[0] > 0
      assert all(isinstance(value, type(values[0])) for value in values)
  
      self.boundaries = boundaries
      self.values = values
  
      super().__init__(
          unit=unit,
          name=name,
          dtype=dtype,
          min_value=min_value,
          max_value=max_value,
      )
  
file_path: tensorforce/tensorforce/core/parameters/piecewise_constant.py
imports: import tensorflow
  from tensorforce import TensorforceError
  from tensorforce.core import tf_util
  from tensorforce.core.parameters import Parameter
label_desc: Use image node_id 1 to create a new PiecewiseConstant object from inherited base classes: Parameter with example: obj = PiecewiseConstant()