code: def _maybe_upsample_and_add_outputs(
      current_level_output,
      previous_level_output: Optional[tf.Tensor] = None,
      use_bilinear_upsampling: bool = True,
  ):
      """Upsamples and adds previous and current level or returns current level.
  
      Args:
        current_level_output: Output of the current level.
        previous_level_output: Output of the previous level. If None
          current_level_output will be returned.
        use_bilinear_upsampling: If true bilinear upsampling is used else nearest
          neighbor.
  
      Returns:
        The sum of the upsampled previous level and the current level.
      """
      if previous_level_output is None:
          return current_level_output
      else:
          upsampled_output = (
              keras_layers.TwoByTwoNearestNeighborUpSampling()(
                  previous_level_output
              )
          )
          if use_bilinear_upsampling:
              upsampled_output = keras_layers.Blur2D()(upsampled_output)
          return current_level_output + upsampled_output
  
file_path: graphics/tensorflow_graphics/projects/gan/architectures_style_gan_v2.py
imports: import math
  from typing import Callable, List, Optional, Sequence, Tuple, Union
  import tensorflow
  from tensorflow_graphics.projects.gan import architectures_progressive_gan
  from tensorflow_graphics.projects.gan import architectures_style_gan
  from tensorflow_graphics.projects.gan import keras_layers
label_desc: Use image node_id 1 for calling a global function with example usage: _maybe_upsample_and_add_outputs(current_level_output, previous_level_output, use_bilinear_upsampling) and returns: current_level_output, unknown