code: def apply_style_with_adain(
      mapped_latent_code: tf.Tensor, input_tensor: tf.Tensor
  ) -> tf.Tensor:
      """Applies a style using Adaptive Instance Normalization (AdaIN).
  
      This function first converts the mapped latent code to a scale and offset for
      AdaIN using an affine transormation, then the style is applied using AdaIN.
  
      Args:
        mapped_latent_code: The mapped latent code that contains the style.
        input_tensor: The input tensor to which the style should be applied.
  
      Returns:
        The input_tensor after applying the style.
      """
      number_of_channels = input_tensor.shape[-1]
      scale_and_offset = keras_layers.FanInScaledDense(
          multiplier=1.0,
          units=2 * number_of_channels,
          kernel_initializer=tf.keras.initializers.TruncatedNormal(
              mean=0.0, stddev=1.0
          ),
      )(mapped_latent_code)
  
      normalized_input_tensor = (
          tfa_normalizations.InstanceNormalization(
              center=False, scale=False
          )(input_tensor)
      )
      scale = scale_and_offset[:, :number_of_channels][
          :, tf.newaxis, tf.newaxis, :
      ]
      offset = scale_and_offset[:, number_of_channels:][
          :, tf.newaxis, tf.newaxis, :
      ]
      # Adding 1.0 to the scale to achieve initialization of the bias to 1.0.
      return tf.keras.layers.add(
          (
              tf.keras.layers.multiply(
                  (normalized_input_tensor, scale + 1.0)
              ),
              offset,
          )
      )
  
file_path: graphics/tensorflow_graphics/projects/gan/architectures_style_gan.py
imports: from typing import Callable, Optional, Sequence, Tuple, Union
  import tensorflow
  import tensorflow_addons.layers.normalizations
  from tensorflow_graphics.projects.gan import architectures_progressive_gan
  from tensorflow_graphics.projects.gan import keras_layers
label_desc: Use image node_id 1 for calling a global function with example usage: apply_style_with_adain(mapped_latent_code, input_tensor) and returns: tf