class_docstr: IntSparseTensorGenerator generates tf.sparse.SparseTensor with dtype in tf.int32 or tf.int64
class_docstr_tok: ["IntSparseTensorGenerator","generates","tf.sparse.SparseTensor","with","dtype","in","tf.int32","or","tf.int64"]
code: def generate(self):
      dtype = self.spec.dtype
      info = np.iinfo(dtype.as_numpy_dtype)
      shape = self._get_shape()
      num_values = self._get_num_values(shape)
      vals = np.random.randint(
          low=info.min,
          high=info.max,
          size=[num_values],
          dtype=dtype.as_numpy_dtype,
      )
      coords = self._generate_random_coords(num_values, shape)
      return tf.SparseTensor(
          indices=coords, values=vals, dense_shape=shape
      )
  
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 2 for calling the IntSparseTensorGenerator obj's underlying member method code with example usage: obj.generate() and returns: tf