code: def get_random_labels_tf(self, minibatch_size):  # => labels
      with tf.name_scope("Dataset"):
          if self.label_size > 0:
              with tf.device("/cpu:0"):
                  return tf.gather(
                      self._tf_labels_var,
                      tf.random_uniform(
                          [minibatch_size],
                          0,
                          self._np_labels.shape[0],
                          dtype=tf.int32,
                      ),
                  )
          return tf.zeros([minibatch_size, 0], self.label_dtype)
  
file_path: insightface/reconstruction/ostec/external/stylegan2/training/dataset.py
imports: import os
  import glob
  import numpy
  import tensorflow
  import dnnlib
  import dnnlib.tflib
label_desc: Use image node_id 6 for calling the TFRecordDataset obj's underlying member method code with example usage: obj.get_random_labels_tf(minibatch_size) and returns: tf, tf