class_docstr: Represents the value of one dimension in a TensorShape.
class_docstr_tok: ["Represents","the","value","of","one","dimension","in","a","TensorShape","."]
docstr: Creates a new Dimension with the given value.
docstr_tok: ["Creates","a","new","Dimension","with","the","given","value","."]
code: def __init__(self, value):
      """Creates a new Dimension with the given value."""
      if value is None:
          self._value = None
      elif isinstance(value, dtypes.DType):
          raise TypeError("Cannot convert %s to Dimension" % value)
      else:
          self._value = int(value)
          if (
              not isinstance(value, compat.bytes_or_text_types)
              and self._value != value
          ):
              raise ValueError("Ambiguous dimension: %s" % value)
          if self._value < 0:
              raise ValueError(
                  "Dimension %d must be >= 0" % self._value
              )
  
imports: from .None import compat, dtypes
  from tensorboard.compat.proto import tensor_shape_pb2
label_desc: Use image node_id 1 to create a new Dimension object  with example: obj = Dimension(value)