class_docstr: Base of VarLenTensorGeneratorBase that generates tf.sparse.SparseTensor.
docstr: Create a new VarLenTensorGeneratorBase.
  
  This must be called by the constructors of subclasses e.g.
  IntVarLenTensorGeneratorBase, FloatVarLenTensorGeneratorBase, etc.
  
  Args:
    spec: A tf.SparseTensorSpec that describes the output tensor.
    dim_dist: Distribution of dimension sizes.
  
  Raises:
    TypeError: If spec is not tf.SparseTensorSpec.
docstr_tok: ["Create","a","new","VarLenTensorGeneratorBase",".","This","must","be","called","by","the","constructors","of","subclasses","e.g",".","IntVarLenTensorGeneratorBase",",","FloatVarLenTensorGeneratorBase",",","etc",".","Args",":","spec",":","A","tf.SparseTensorSpec","that","describes","the","output","tensor",".","dim_dist",":","Distribution","of","dimension","sizes",".","Raises",":","TypeError",":","If","spec","is","not","tf.SparseTensorSpec","."]
code: def __init__(self, spec, dim_dist):
      """Create a new VarLenTensorGeneratorBase.
  
      This must be called by the constructors of subclasses e.g.
      IntVarLenTensorGeneratorBase, FloatVarLenTensorGeneratorBase, etc.
  
      Args:
        spec: A tf.SparseTensorSpec that describes the output tensor.
        dim_dist: Distribution of dimension sizes.
  
      Raises:
        TypeError: If spec is not tf.SparseTensorSpec.
      """
      super().__init__(spec)
      if not isinstance(spec, tf.SparseTensorSpec):
          raise TypeError(
              "Input spec must be a tf.SparseTensorSpec in VarLenTensorGenerator "
              f"but found {spec}"
          )
  
      if not isinstance(dim_dist, DimensionDistribution):
          raise TypeError(
              f"dim_dist must be a DimensionDistribution but found {dim_dist}"
          )
  
      if self.spec.shape.rank is None:
          raise ValueError(f"Input spec must have known rank")
  
      self._dim_dist = dim_dist
  
imports: import enum
  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 VarLenTensorGeneratorBase object from inherited base classes: Generator with example: obj = VarLenTensorGeneratorBase(spec, dim_dist)