          -------
          tensor
              The output tensor from the upscale block
          """
          upscaler = _get_upscale_layer(self._config["dec_upscale_method"].lower(), filters)
  
          var_x = upscaler(inputs)
          if not is_mask and self._config["dec_gaussian"]:
              var_x = GaussianNoise(1.0)(var_x)
          if not is_mask and self._config["dec_res_blocks"] and not skip_residual:
 
</s> remove         upscales = int(np.log2(self._config["output_size"] / K.int_shape(var_x)[1]))
        filters = _get_curve(self._config["dec_max_filters"],
                             self._config["dec_min_filters"],
                             upscales,
                             self._config["dec_filter_slope"],
                             mode=self._config["dec_slope_mode"])
 </s> add         if not self._filters:
            upscales = int(np.log2(self._config["output_size"] / K.int_shape(var_x)[1]))
            self._filters.extend(_get_curve(self._config["dec_max_filters"],
                                            self._config["dec_min_filters"],
                                            upscales,
                                            self._config["dec_filter_slope"],
                                            mode=self._config["dec_slope_mode"]))
            logger.debug("Generated class filters: %s", self._filters)

        filters = self._filters[start_idx: end_idx] </s> remove         return KerasModel(input_, var_x, name=f"fc_{self._side}")


class GBlock():  # pylint:disable=too-few-public-methods
    """ G-Block model, borrowing from Adain StyleGAN.

    Parameters
    ----------
    side: ["a", "b", "both"]
        The side of the model that the fully connected layers belong to. Used for naming
    input_shapes: list or tuple
        The shape tuples for the input to the decoder. The first item is the input from each side's
        fully connected model, the second item is the input shape from the combined fully connected
        model.
    config: dict
        The user configuration dictionary
    """
    def __init__(self,
                 side: Literal["a", "b", "both"],
                 input_shapes: Union[list, tuple],
                 config: dict) -> None:
        logger.debug("Initializing: %s (side: %s, input_shapes: %s)",
                     self.__class__.__name__, side, input_shapes)
        self._side = side
        self._config = config
        self._inputs = [Input(shape=shape) for shape in input_shapes]
        self._dense_nodes = 512
        self._dense_recursions = 3
        logger.debug("Initialized: %s", self.__class__.__name__)

    @classmethod
    def _g_block(cls, inputs: Tensor, style: Tensor, filters: int, recursions: int = 2) -> Tensor:
        """ G_block adapted from ADAIN StyleGAN.

        Parameters
        ----------
        inputs: tensor
            The input tensor to the G-Block model
        style: tensor
            The input combined 'style' tensor to the G-Block model
        filters: int
            The number of filters to use for the G-Block Convolutional layers
        recursions: int, optional
            The number of recursive Convolutions to process. Default: `2`

        Returns
        -------
        tensor
            The output tensor from the G-Block model
        """
        var_x = inputs
        for i in range(recursions):
            styles = [Reshape([1, 1, filters])(Dense(filters)(style)) for _ in range(2)]
            noise = KConv2D(filters, 1, padding="same")(GaussianNoise(1.0)(var_x))

            if i == recursions - 1:
                var_x = KConv2D(filters, 3, padding="same")(var_x)

            var_x = AdaInstanceNormalization(dtype="float32")([var_x, *styles])
            var_x = Add()([var_x, noise])
            var_x = LeakyReLU(0.2)(var_x)

        return var_x
 </s> add             num_upscales = self._config["dec_upscales_in_fc"]
            if num_upscales:
                var_x = UpscaleBlocks(self._side,
                                      K.int_shape(var_x)[1:],
                                      self._config,
                                      layer_indicies=(0, num_upscales))(var_x) </s> remove         if self._is_dny:
            var_x = self._dny_entry(var_x)
        if self._is_dny and self._config["learn_mask"]:
            var_y = self._dny_entry(var_y)
 </s> add             if self._is_dny:
                var_x = self._dny_entry(var_x)
            if self._is_dny and self._config["learn_mask"]:
                var_y = self._dny_entry(var_y) </s> remove         if self._config["learn_mask"]:
            var_y = inputs
            var_y = self._reshape_for_output(var_y)
 </s> add         if start_idx == 0:
            var_x = self._reshape_for_output(var_x)

            if self._config["learn_mask"]:
                var_y = inputs
                var_y = self._reshape_for_output(var_y) </s> remove         # Scale g_block filters to side dense
        g_filts = K.int_shape(var_x)[-1]
        var_x = Conv2D(g_filts, 3, strides=1, padding="same")(var_x)
        var_x = GaussianNoise(1.0)(var_x)
        var_x = self._g_block(var_x, style, g_filts)
        return KerasModel(self._inputs, var_x, name=f"g_block_{self._side}")
 </s> add class UpscaleBlocks():  # pylint: disable=too-few-public-methods
    """ Obtain a block of upscalers.
        upscaler = _get_upscale_layer(self._config["dec_upscale_method"].lower(),
                                      filters,
                                      activation="leakyrelu",
                                      upsamples=2,
                                      interpolation="bilinear")
          -------
          tensor
              The output tensor from the upscale block
          """
        upscaler = _get_upscale_layer(self._config["dec_upscale_method"].lower(),
                                      filters,
                                      activation="leakyrelu",
                                      upsamples=2,
                                      interpolation="bilinear")
  
          var_x = upscaler(inputs)
          if not is_mask and self._config["dec_gaussian"]:
              var_x = GaussianNoise(1.0)(var_x)
          if not is_mask and self._config["dec_res_blocks"] and not skip_residual:
keep keep keep keep replace keep keep keep keep keep
 Train updates
  - Output full model summary last
  - Fix activations in Phaze-A upscales
  - Phaze-A Add option to place some upscales in fc model 
plugins/train/model/phaze_a.py