class_docstr: Base of SparseTensorGenerator that generates tf.sparse.SparseTensor.
class_docstr_tok: ["Base","of","SparseTensorGenerator","that","generates","tf.sparse.SparseTensor","."]
docstr: Convert an integer to its corresponding location in a tensor, in row-major order.
  For example, in the 2d tensor
  [[0, 1, 2]
   [3, 4, 5]]
  The index 3 will return [1, 0] (i.e. the entry in the second row, first column)
docstr_tok: ["Convert","an","integer","to","its","corresponding","location","in","a","tensor",",","in","row-major","order",".","For","example",",","in","the","2d","tensor","[","[","0",",","1",",","2","]","[","3",",","4",",","5","]","]","The","index","3","will","return","[","1",",","0","]","(","i.e",".","the","entry","in","the","second","row",",","first","column",")"]
code: def _int_to_coord(self, idx, shape):
      """Convert an integer to its corresponding location in a tensor, in row-major order.
      For example, in the 2d tensor
      [[0, 1, 2]
       [3, 4, 5]]
      The index 3 will return [1, 0] (i.e. the entry in the second row, first column)
      """
      rank = len(shape)
      ret = [0] * rank
      for dim in range(rank):
          val = idx % (shape[rank - dim - 1])
          ret[rank - dim - 1] = val
          idx = (idx - val) // shape[rank - dim - 1]
      return ret
  
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 5 for calling the SparseTensorGeneratorBase obj's underlying member method code with example usage: obj._int_to_coord(idx, shape) and returns: ret