def __init__(
        self,
        model: TFTModel,
        background_series: Optional[Union[TimeSeries, Sequence[TimeSeries]]] = None,
        background_past_covariates: Optional[
            Union[TimeSeries, Sequence[TimeSeries]]
        ] = None,
        background_future_covariates: Optional[
            Union[TimeSeries, Sequence[TimeSeries]]
        ] = None,
    ):
        """
        Explainer class for the `TFTModel`.

        **Definitions**

        - A background series is a `TimeSeries` that is used as a default for generating the explainability result
          (if no `foreground` is passed to :func:`explain() <TFTExplainer.explain>`).
        - A foreground series is a `TimeSeries` that can be passed to :func:`explain() <TFTExplainer.explain>` to use
          instead of the background for generating the explainability result.

        Parameters
        ----------
        model
            The fitted `TFTModel` to be explained.
        background_series
            Optionally, a series or list of series to use as a default target series for the explanations.
            Optional if `model` was trained on a single target series. By default, it is the `series` used at fitting
            time.
            Mandatory if `model` was trained on multiple (sequence of) target series.
        background_past_covariates
            Optionally, a past covariates series or list of series to use as a default past covariates series
            for the explanations. The same requirements apply as for `background_series` .
        background_future_covariates
            Optionally, a future covariates series or list of series to use as a default future covariates series
            for the explanations. The same requirements apply as for `background_series`.

        Examples
        --------
        >>> from darts.datasets import AirPassengersDataset
        >>> from darts.explainability.tft_explainer import TFTExplainer
        >>> from darts.models import TFTModel
        >>> series = AirPassengersDataset().load()
        >>> model = TFTModel(
        >>>     input_chunk_length=12,
        >>>     output_chunk_length=6,
        >>>     add_encoders={"cyclic": {"future": ["hour"]}}
        >>> )
        >>> model.fit(series)
        >>> # create the explainer and generate explanations
        >>> explainer = TFTExplainer(model)
        >>> results = explainer.explain()
        >>> # plot the results
        >>> explainer.plot_attention(results, plot_type="all")
        >>> explainer.plot_variable_selection(results)
        """
        super().__init__(
            model,
            background_series=background_series,
            background_past_covariates=background_past_covariates,
            background_future_covariates=background_future_covariates,
            requires_background=True,
            requires_covariates_encoding=False,
            check_component_names=False,
            test_stationarity=False,
        )
        # add the relative index that generated inside the model (not in the input data)
        if model.add_relative_index:
            if self.future_covariates_components is not None:
                self.future_covariates_components.append("add_relative_index")
            else:
                self.future_covariates_components = ["add_relative_index"]

        Explainer class for the `TFTModel`.

        **Definitions**

        - A background series is a `TimeSeries` that is used as a default for generating the explainability result
          (if no `foreground` is passed to :func:`explain() <TFTExplainer.explain>`).
        - A foreground series is a `TimeSeries` that can be passed to :func:`explain() <TFTExplainer.explain>` to use
          instead of the background for generating the explainability result.

        Parameters
        ----------
        model
            The fitted `TFTModel` to be explained.
        background_series
            Optionally, a series or list of series to use as a default target series for the explanations.
            Optional if `model` was trained on a single target series. By default, it is the `series` used at fitting
            time.
            Mandatory if `model` was trained on multiple (sequence of) target series.
        background_past_covariates
            Optionally, a past covariates series or list of series to use as a default past covariates series
            for the explanations. The same requirements apply as for `background_series` .
        background_future_covariates
            Optionally, a future covariates series or list of series to use as a default future covariates series
            for the explanations. The same requirements apply as for `background_series`.

        Examples
        --------
        >>> from darts.datasets import AirPassengersDataset
        >>> from darts.explainability.tft_explainer import TFTExplainer
        >>> from darts.models import TFTModel
        >>> series = AirPassengersDataset().load()
        >>> model = TFTModel(
        >>>     input_chunk_length=12,
        >>>     output_chunk_length=6,
        >>>     add_encoders={"cyclic": {"future": ["hour"]}}
        >>> )
        >>> model.fit(series)
        >>> # create the explainer and generate explanations
        >>> explainer = TFTExplainer(model)
        >>> results = explainer.explain()
        >>> # plot the results
        >>> explainer.plot_attention(results, plot_type="all")
        >>> explainer.plot_variable_selection(results)
        
darts/explainability/tft_explainer.py