code: def Conv2DTranspose(
      inputs,
      filters,
      kernel_size,
      strides=(1, 1),
      padding="same",
      data_format="channels_last",
      activation=None,
      use_bias=True,
      kernel_initializer=None,
      bias_initializer=tf.zeros_initializer(),
      kernel_regularizer=None,
      bias_regularizer=None,
      activity_regularizer=None,
  ):
      """
      A wrapper around `tf.layers.Conv2DTranspose`.
      Some differences to maintain backward-compatibility:
  
      1. Default kernel initializer is variance_scaling_initializer(2.0).
      2. Default padding is 'same'
  
      Variable Names:
  
      * ``W``: weights
      * ``b``: bias
      """
      if kernel_initializer is None:
          if get_tf_version_tuple() <= (1, 12):
              kernel_initializer = (
                  tf.contrib.layers.variance_scaling_initializer(2.0)
              )  # deprecated
          else:
              kernel_initializer = (
                  tf.keras.initializers.VarianceScaling(
                      2.0, distribution="untruncated_normal"
                  )
              )
  
      if get_tf_version_tuple() <= (1, 12):
          with rename_get_variable({"kernel": "W", "bias": "b"}):
              layer = tf.layers.Conv2DTranspose(
                  filters,
                  kernel_size,
                  strides=strides,
                  padding=padding,
                  data_format=data_format,
                  activation=activation,
                  use_bias=use_bias,
                  kernel_initializer=kernel_initializer,
                  bias_initializer=bias_initializer,
                  kernel_regularizer=kernel_regularizer,
                  bias_regularizer=bias_regularizer,
                  activity_regularizer=activity_regularizer,
                  _reuse=tf.get_variable_scope().reuse,
              )
              ret = layer.apply(inputs, scope=tf.get_variable_scope())
              ret = tf.identity(ret, name="output")
          ret.variables = VariableHolder(W=layer.kernel)
          if use_bias:
              ret.variables.b = layer.bias
      else:
          # Our own implementation, to avoid Keras bugs. https://github.com/tensorflow/tensorflow/issues/25946
          assert (
              kernel_regularizer is None
              and bias_regularizer is None
              and activity_regularizer is None
          ), "Unsupported arguments due to Keras bug in TensorFlow 1.13"
          data_format = get_data_format(data_format, keras_mode=False)
          shape_dyn = tf.shape(inputs)
          shape_sta = inputs.shape.as_list()
          strides2d = shape2d(strides)
          kernel_shape = shape2d(kernel_size)
  
          assert padding.lower() in [
              "valid",
              "same",
          ], "Padding {} is not supported!".format(padding)
  
          if padding.lower() == "valid":
              shape_res2d = [
                  max(kernel_shape[0] - strides2d[0], 0),
                  max(kernel_shape[1] - strides2d[1], 0),
              ]
          else:
              shape_res2d = shape2d(0)
  
          if data_format == "NCHW":
              channels_in = shape_sta[1]
              out_shape_dyn = tf.stack(
                  [
                      shape_dyn[0],
                      filters,
                      shape_dyn[2] * strides2d[0] + shape_res2d[0],
                      shape_dyn[3] * strides2d[1] + shape_res2d[1],
                  ]
              )
              out_shape3_sta = [
                  filters,
                  None
                  if shape_sta[2] is None
                  else shape_sta[2] * strides2d[0] + shape_res2d[0],
                  None
                  if shape_sta[3] is None
                  else shape_sta[3] * strides2d[1] + shape_res2d[1],
              ]
          else:
              channels_in = shape_sta[-1]
              out_shape_dyn = tf.stack(
                  [
                      shape_dyn[0],
                      shape_dyn[1] * strides2d[0] + shape_res2d[0],
                      shape_dyn[2] * strides2d[1] + shape_res2d[1],
                      filters,
                  ]
              )
              out_shape3_sta = [
                  None
                  if shape_sta[1] is None
                  else shape_sta[1] * strides2d[0] + shape_res2d[0],
                  None
                  if shape_sta[2] is None
                  else shape_sta[2] * strides2d[1] + shape_res2d[1],
                  filters,
              ]
  
          inputs_dtype = inputs.dtype
          W = tf.get_variable(
              "W",
              kernel_shape + [filters, channels_in],
              dtype=inputs_dtype,
              initializer=kernel_initializer,
          )
          if use_bias:
              b = tf.get_variable(
                  "b",
                  [filters],
                  dtype=inputs_dtype,
                  initializer=bias_initializer,
              )
          conv = tf.nn.conv2d_transpose(
              inputs,
              W,
              out_shape_dyn,
              shape4d(strides, data_format=data_format),
              padding=padding.upper(),
              data_format=data_format,
          )
          conv.set_shape(
              tf.TensorShape([shape_sta[0]] + out_shape3_sta)
          )
  
          ret = (
              tf.nn.bias_add(conv, b, data_format=data_format)
              if use_bias
              else conv
          )
          if activation is not None:
              ret = activation(ret)
          ret = tf.identity(ret, name="output")
  
          ret.variables = VariableHolder(W=W)
          if use_bias:
              ret.variables.b = b
  
      return ret
  
imports: from ..compat import tfv1
  from ..tfutils.common import get_tf_version_tuple
  from ..utils.argtools import get_data_format, shape2d, shape4d, log_once
  from .common import VariableHolder, layer_register
  from .tflayer import convert_to_tflayer_args, rename_get_variable
label_desc: Use image node_id 2 for calling a global function with example usage: Conv2DTranspose(inputs, filters, kernel_size, strides, padding, data_format, activation, use_bias, kernel_initializer, bias_initializer, kernel_regularizer, bias_regularizer, activity_regularizer) and returns: ret