docstr: Tests upsampling with presets.
docstr_tok: ["Tests","upsampling","with","presets","."]
code: def test_upsample_transposed_convolution_preset_padded(self):
      """Tests upsampling with presets."""
      data = np.reshape(np.arange(12).astype(np.float32), (2, 3, 2))
      data[0, -1, :] = 0.0
      sizes = ((2, 3), (3, 3))
      pool_map = _dense_to_sparse(
          np.array(
              (
                  ((0.5, 0.5, 0.0), (0.0, 0.0, 1.0), (0.0, 0.0, 0.0)),
                  ((1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, 1.0)),
              ),
              dtype=np.float32,
          )
      )
  
      kernel = np.ones(shape=(1, 2, 2, 2), dtype=np.float32)
      initializer = tf.constant_initializer(value=kernel)
      transposed_convolution_op = tf.keras.layers.Conv2DTranspose(
          filters=2,
          kernel_size=(1, 2),
          strides=(1, 2),
          padding="valid",
          use_bias=False,
          kernel_initializer=initializer,
      )
  
      # Convolving with an all-ones kernel is equal to summation of the input.
      data_sum = np.tile(
          np.sum(data, axis=-1, keepdims=True), (1, 1, 2)
      )
      true = np.zeros(shape=(2, 3, 2), dtype=np.float32)
      true[0, :, :] = data_sum[0, (0, 0, 1), :]
      true[1, :, :] = data_sum[1, :, :]
      upsampled = gp.upsample_transposed_convolution(
          data,
          pool_map,
          sizes=sizes,
          kernel_size=2,
          transposed_convolution_op=transposed_convolution_op,
      )
  
      # Initializes variables of the transpose conv layer.
      self.evaluate(tf.compat.v1.global_variables_initializer())
  
      self.assertAllEqual(upsampled.shape, (2, 3, 2))
      self.assertAllClose(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 6 for calling the GraphPoolingUpsampleTransposeConvolutionTests obj's underlying member method code with example usage: obj.test_upsample_transposed_convolution_preset_padded() without return types