code: def G_mapping(
      latents_in,  # First input: Latent vectors (Z) [minibatch, latent_size].
      labels_in,  # Second input: Conditioning labels [minibatch, label_size].
      latent_size=512,  # Latent vector (Z) dimensionality.
      label_size=0,  # Label dimensionality, 0 if no labels.
      dlatent_size=512,  # Disentangled latent (W) dimensionality.
      dlatent_broadcast=None,  # Output disentangled latent (W) as [minibatch, dlatent_size] or [minibatch, dlatent_broadcast, dlatent_size].
      mapping_layers=8,  # Number of mapping layers.
      mapping_fmaps=512,  # Number of activations in the mapping layers.
      mapping_lrmul=0.01,  # Learning rate multiplier for the mapping layers.
      mapping_nonlinearity="lrelu",  # Activation function: 'relu', 'lrelu'.
      use_wscale=True,  # Enable equalized learning rate?
      normalize_latents=True,  # Normalize latent vectors (Z) before feeding them to the mapping layers?
      dtype="float32",  # Data type to use for activations and outputs.
      **_kwargs,
  ):  # Ignore unrecognized keyword args.
      act, gain = {
          "relu": (tf.nn.relu, np.sqrt(2)),
          "lrelu": (leaky_relu, np.sqrt(2)),
      }[mapping_nonlinearity]
  
      # Inputs.
      latents_in.set_shape([None, latent_size])
      labels_in.set_shape([None, label_size])
      latents_in = tf.cast(latents_in, dtype)
      labels_in = tf.cast(labels_in, dtype)
      x = latents_in
  
      # Embed labels and concatenate them with latents.
      if label_size:
          with tf.variable_scope("LabelConcat"):
              w = tf.get_variable(
                  "weight",
                  shape=[label_size, latent_size],
                  initializer=tf.initializers.random_normal(),
              )
              y = tf.matmul(labels_in, tf.cast(w, dtype))
              x = tf.concat([x, y], axis=1)
  
      # Normalize latents.
      if normalize_latents:
          x = pixel_norm(x)
  
      # Mapping layers.
      for layer_idx in range(mapping_layers):
          with tf.variable_scope("Dense%d" % layer_idx):
              fmaps = (
                  dlatent_size
                  if layer_idx == mapping_layers - 1
                  else mapping_fmaps
              )
              x = dense(
                  x,
                  fmaps=fmaps,
                  gain=gain,
                  use_wscale=use_wscale,
                  lrmul=mapping_lrmul,
              )
              x = apply_bias(x, lrmul=mapping_lrmul)
              x = act(x)
  
      # Broadcast.
      if dlatent_broadcast is not None:
          with tf.variable_scope("Broadcast"):
              x = tf.tile(x[:, np.newaxis], [1, dlatent_broadcast, 1])
  
      # Output.
      assert x.dtype == tf.as_dtype(dtype)
      return tf.identity(x, name="dlatents_out")
  
imports: import numpy
  import tensorflow
  import dnnlib
  import dnnlib.tflib
label_desc: Use image node_id 20 for calling a global function with example usage: G_mapping(latents_in, labels_in, latent_size, label_size, dlatent_size, dlatent_broadcast, mapping_layers, mapping_fmaps, mapping_lrmul, mapping_nonlinearity, use_wscale, normalize_latents, dtype) and returns: tf