code: def conv2d_downscale2d(
      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:]) >= 128
  
      # Not fused => call the individual ops directly.
      if not fused_scale:
          return downscale2d(conv2d(x, fmaps, kernel, **kwargs))
  
      # Fused => perform both ops simultaneously using tf.nn.conv2d().
      w = get_weight(
          [kernel, kernel, x.shape[1].value, fmaps], **kwargs
      )
      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]])
          * 0.25
      )
      w = tf.cast(w, x.dtype)
      return tf.nn.conv2d(
          x, w, 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 11 for calling a global function with example usage: conv2d_downscale2d(x, fmaps, kernel, fused_scale) and returns: tf, downscale2d