class_docstr: Base of TensorGenerator that generates tf.Tensor.
docstr: Create a new TensorGeneratorBase.
  
  This must be called by the constructors of subclasses e.g.
  IntTensorGenerator, FloatTensorGenerator, etc.
  
  Args:
    spec: A tf.TensorSpec that describes the output tensor.
  
  Raises:
    TypeError: If spec is not tf.TensorSpec.
    ValueError: If shape in spec is not fully defined.
docstr_tok: ["Create","a","new","TensorGeneratorBase",".","This","must","be","called","by","the","constructors","of","subclasses","e.g",".","IntTensorGenerator",",","FloatTensorGenerator",",","etc",".","Args",":","spec",":","A","tf.TensorSpec","that","describes","the","output","tensor",".","Raises",":","TypeError",":","If","spec","is","not","tf.TensorSpec",".","ValueError",":","If","shape","in","spec","is","not","fully","defined","."]
code: def __init__(self, spec):
      """Create a new TensorGeneratorBase.
  
      This must be called by the constructors of subclasses e.g.
      IntTensorGenerator, FloatTensorGenerator, etc.
  
      Args:
        spec: A tf.TensorSpec that describes the output tensor.
  
      Raises:
        TypeError: If spec is not tf.TensorSpec.
        ValueError: If shape in spec is not fully defined.
      """
      super().__init__(spec)
  
      if not isinstance(spec, tf.TensorSpec):
          raise TypeError(
              "Input spec must be a tf.TensorSpec in TensorGenerator "
              f"but found {spec}"
          )
  
      spec.shape.assert_is_fully_defined()
  
imports: import hashlib
  import numpy
  import tensorflow
  from tests.test_atds_avro.utils.generator.generator_base import Generator
  from tests.test_atds_avro.utils.hash_util import int_to_bytes
label_desc: Use image node_id 1 to create a new TensorGeneratorBase object from inherited base classes: Generator with example: obj = TensorGeneratorBase(spec)