class_docstr: BoolSparseTensorGenerator generates tf.sparse.SparseTensor with dtype in tf.bool.
class_docstr_tok: ["BoolSparseTensorGenerator","generates","tf.sparse.SparseTensor","with","dtype","in","tf.bool","."]
docstr: Create a new BoolSparseTensorGenerator.
  
  The generated bool value has equal true and false possibility.
  
  Args:
    spec: A tf.SparseTensorSpec that describes the output tensor.
    num_values: A value distribution or an int specifying number of non-zero values in the sparse tensor.
  
  Raises:
    TypeError: If dtype in spec is not tf.bool.
docstr_tok: ["Create","a","new","BoolSparseTensorGenerator",".","The","generated","bool","value","has","equal","true","and","false","possibility",".","Args",":","spec",":","A","tf.SparseTensorSpec","that","describes","the","output","tensor",".","num_values",":","A","value","distribution","or","an","int","specifying","number","of","non-zero","values","in","the","sparse","tensor",".","Raises",":","TypeError",":","If","dtype","in","spec","is","not","tf.bool","."]
code: def __init__(self, spec, num_values):
      """Create a new BoolSparseTensorGenerator.
  
      The generated bool value has equal true and false possibility.
  
      Args:
        spec: A tf.SparseTensorSpec that describes the output tensor.
        num_values: A value distribution or an int specifying number of non-zero values in the sparse tensor.
  
      Raises:
        TypeError: If dtype in spec is not tf.bool.
      """
      super().__init__(spec, num_values)
  
      if spec.dtype is not tf.bool:
          raise TypeError(
              "BoolSparseTensorGenerator can only generate tf.sparse.SparseTensor with "
              f"dtype in tf.bool but found {spec.dtype}."
          )
  
imports: import enum
  import random
  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 BoolSparseTensorGenerator object from inherited base classes: SparseTensorGeneratorBase with example: obj = BoolSparseTensorGenerator(spec, num_values)