class_docstr: Tests for util functions.
code: def test_form_group_indices_nd(self):
      tf.random.set_seed(1)
      # batch_size, list_size = 2, 3.
      is_valid = [[True, True, True], [True, True, False]]
      indices, mask = model._form_group_indices_nd(
          is_valid, group_size=2, shuffle=True, seed=87124
      )
  
      # shape = [2, 3, 2, 2] = [batch_size, num_groups , group_size, 2].
      self.assertAllEqual(
          indices,
          [  # batch_size = 2.
              [  # num_groups = 3.
                  [[0, 0], [0, 1]],
                  [[0, 1], [0, 2]],
                  [[0, 2], [0, 0]],
              ],
              [  # num_groups = 3.
                  [[1, 1], [1, 0]],
                  [[1, 0], [1, 1]],
                  [[1, 1], [1, 0]],
              ],
          ],
      )
      # shape = [2, 3] = [batch_size, num_groups]
      self.assertAllEqual(
          mask, [[True, True, True], [True, True, False]]
      )
  
      # Disable shuffling.
      indices, mask = model._form_group_indices_nd(
          is_valid, group_size=2, shuffle=False
      )
  
      # shape = [2, 3, 2, 2] = [batch_size, num_groups , group_size, 2].
      self.assertAllEqual(
          indices,
          [  # batch_size = 2.
              [  # num_groups = 3.
                  [[0, 0], [0, 1]],
                  [[0, 1], [0, 2]],
                  [[0, 2], [0, 0]],
              ],
              [  # num_groups = 3.
                  [[1, 0], [1, 1]],
                  [[1, 1], [1, 0]],
                  [[1, 0], [1, 1]],
              ],
          ],
      )
      # shape = [2, 3] = [batch_size, num_groups]
      self.assertAllEqual(
          mask, [[True, True, True], [True, True, False]]
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from absl.testing import parameterized
  import tensorflow
  from tensorflow import estimator
  from tensorflow_ranking.python import feature
  from tensorflow_ranking.python import head
  from tensorflow_ranking.python import losses
  from tensorflow_ranking.python import model
label_desc: Use image node_id 3 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_form_group_indices_nd() without return types