class_docstr: IntTensorGenerator generates tf.Tensor with dtype in tf.int32 or tf.int64
docstr: Create a new IntTensorGenerator
  
  With tf.int32 dtype, the generated int range is between -2^31 to 2^31 - 1.
  With tf.int64 dtype, the generated int range is between -2^63 to 2^63 - 1.
  
  Args:
    spec: A tf.TensorSpec that describes the output tensor.
  
  Raises:
    TypeError: If dtype in spec is not tf.int32 or tf.int64.
docstr_tok: ["Create","a","new","IntTensorGenerator","With","tf.int32","dtype",",","the","generated","int","range","is","between","-2^31","to","2^31","-","1",".","With","tf.int64","dtype",",","the","generated","int","range","is","between","-2^63","to","2^63","-","1",".","Args",":","spec",":","A","tf.TensorSpec","that","describes","the","output","tensor",".","Raises",":","TypeError",":","If","dtype","in","spec","is","not","tf.int32","or","tf.int64","."]
code: def __init__(self, spec):
      """Create a new IntTensorGenerator
  
      With tf.int32 dtype, the generated int range is between -2^31 to 2^31 - 1.
      With tf.int64 dtype, the generated int range is between -2^63 to 2^63 - 1.
  
      Args:
        spec: A tf.TensorSpec that describes the output tensor.
  
      Raises:
        TypeError: If dtype in spec is not tf.int32 or tf.int64.
      """
      super().__init__(spec)
  
      if spec.dtype not in [tf.int32, tf.int64]:
          raise TypeError(
              "IntTensorGenerator can only generate tf.Tensor with "
              f"dtype in tf.int32 or tf.int64 but found {spec.dtype}."
          )
  
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 IntTensorGenerator object from inherited base classes: TensorGeneratorBase with example: obj = IntTensorGenerator(spec)