code: def __init__(
      self,
      *,
      type,
      shape=(),
      min_value=None,
      max_value=None,
      num_values=None,
      overwrite=False,
  ):
      super().__setattr__("overwrite", True)
      super().__setattr__("type", None)
      if isinstance(type, tf.dtypes.DType):
          super().__setattr__("_tf_type", type)
          assert not overwrite
      self.type = type
      self.shape = shape
      if num_values is not None and (
          min_value is not None or max_value is not None
      ):
          if self.type == "int":
              raise TensorforceError.invalid(
                  name="TensorSpec",
                  argument="min/max_value",
                  condition="type is int and num_values specified",
              )
          elif self.type == "float":
              raise TensorforceError.invalid(
                  name="TensorSpec",
                  argument="num_values",
                  condition="type is float and min/max_value specified",
              )
      if min_value is not None:
          self.min_value = min_value
      if max_value is not None:
          self.max_value = max_value
      if num_values is not None:
          self.num_values = num_values
      super().__setattr__("overwrite", overwrite)
  
imports: from functools import total_ordering
  import numpy
  import tensorflow
  from tensorforce import TensorforceError, util
  from tensorforce.core.utils import tf_util
label_desc: Use image node_id 1 to create a new TensorSpec object from inherited base classes: object with example: obj = TensorSpec()