def __init__(self, index_generator: CovariatesIndexGenerator, attribute: str):
        """
        Parameters
        ----------
        index_generator
            An instance of `CovariatesIndexGenerator` with methods `generate_train_idx()` and
            `generate_inference_idx()`. Used to generate the index for encoders.
        attribute
            Currently only 'relative' is supported. The generated encoded values will range from (-inf, inf) and the
            target series end time will be used as a reference to evaluate the relative index positions.
        """
        raise_if_not(
            isinstance(attribute, str) and attribute in INTEGER_INDEX_ATTRIBUTES,
            f"Encountered invalid encoder argument `{attribute}` for encoder `position`. "
            f'Attribute must be `"relative"`.',
            logger,
        )
        super().__init__(index_generator)

        self.attribute = attribute

        Parameters
        ----------
        index_generator
            An instance of `CovariatesIndexGenerator` with methods `generate_train_idx()` and
            `generate_inference_idx()`. Used to generate the index for encoders.
        attribute
            Currently only 'relative' is supported. The generated encoded values will range from (-inf, inf) and the
            target series end time will be used as a reference to evaluate the relative index positions.
        
darts/dataprocessing/encoders/encoders.py