code: def upscale2d_conv2d(x, fmaps, kernel, fused_scale="auto", **kwargs):
      assert kernel >= 1 and kernel % 2 == 1
      assert fused_scale in [True, False, "auto"]
      if fused_scale == "auto":
          fused_scale = min(x.shape[2:]) * 2 >= 128
  
      # Not fused => call the individual ops directly.
      if not fused_scale:
          return conv2d(upscale2d(x), fmaps, kernel, **kwargs)
  
      # Fused => perform both ops simultaneously using tf.nn.conv2d_transpose().
      w = get_weight(
          [kernel, kernel, x.shape[1].value, fmaps], **kwargs
      )
      w = tf.transpose(
          w, [0, 1, 3, 2]
      )  # [kernel, kernel, fmaps_out, fmaps_in]
      w = tf.pad(w, [[1, 1], [1, 1], [0, 0], [0, 0]], mode="CONSTANT")
      w = tf.add_n([w[1:, 1:], w[:-1, 1:], w[1:, :-1], w[:-1, :-1]])
      w = tf.cast(w, x.dtype)
      os = [tf.shape(x)[0], fmaps, x.shape[2] * 2, x.shape[3] * 2]
      return tf.nn.conv2d_transpose(
          x,
          w,
          os,
          strides=[1, 1, 2, 2],
          padding="SAME",
          data_format="NCHW",
      )
  
imports: import numpy
  import tensorflow
  import dnnlib
  import dnnlib.tflib
label_desc: Use image node_id 10 for calling a global function with example usage: upscale2d_conv2d(x, fmaps, kernel, fused_scale) and returns: tf, conv2d