docstr: Tests the upsampling with an indicator kernel.
docstr_tok: ["Tests","the","upsampling","with","an","indicator","kernel","."]
code: def test_upsample_transposed_convolution_selector_kernel_random(
      self,
      num_vertices,
      num_features,
      kernel_size,
      kernel_index,
      feature1_index,
      feature2_index,
  ):
      """Tests the upsampling with an indicator kernel."""
      data = np.random.uniform(
          size=(num_vertices, num_features)
      ).astype(np.float32)
      pool_map = np.zeros(
          shape=(num_vertices, num_vertices * kernel_size),
          dtype=np.float32,
      )
      for i in range(num_vertices):
          pool_map[
              i, np.arange(kernel_size * i, kernel_size * (i + 1))
          ] = (1.0 / kernel_size)
      pool_map = _dense_to_sparse(pool_map)
  
      selection = np.zeros(
          shape=(1, kernel_size, num_features, num_features),
          dtype=np.float32,
      )
      selection[0, kernel_index, feature1_index, feature2_index] = 1.0
      initializer = tf.constant_initializer(value=selection)
      transposed_convolution_op = tf.keras.layers.Conv2DTranspose(
          filters=num_features,
          kernel_size=(1, kernel_size),
          strides=(1, kernel_size),
          padding="valid",
          use_bias=False,
          kernel_initializer=initializer,
      )
  
      true = np.zeros(
          shape=(num_vertices * kernel_size, num_features),
          dtype=np.float32,
      )
      input_column = feature2_index
      output_column = feature1_index
      output_row_start = kernel_index
      true[output_row_start::kernel_size, output_column] = data[
          :, input_column
      ]
      upsampled = gp.upsample_transposed_convolution(
          data,
          pool_map,
          sizes=None,
          kernel_size=kernel_size,
          transposed_convolution_op=transposed_convolution_op,
      )
  
      # Initializes variables of the transpose conv layer.
      self.evaluate(tf.compat.v1.global_variables_initializer())
  
      self.assertAllEqual(upsampled, true)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import itertools
  from absl.testing import parameterized
  import numpy
  from six.moves import range
  import tensorflow
  import tensorflow_graphics.geometry.convolution.graph_pooling
  from tensorflow_graphics.geometry.convolution.tests import utils_test
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 5 for calling the GraphPoolingUpsampleTransposeConvolutionTests obj's underlying member method code with example usage: obj.test_upsample_transposed_convolution_selector_kernel_random(num_vertices, num_features, kernel_size, kernel_index, feature1_index, feature2_index) without return types