def __init__(
        self, *sequences: Sequence, targets: Union[int, Sequence[TTargetType]] = 1
    ):
        """
        Creates a ``SequenceDataset`` instance.

        Beware that the second sequence, will be used to fill the targets
        field without running any kind of type conversion.

        :param sequences: A sequence of sequences, Tensors or ndarrays
            representing the patterns.
        :param targets: A sequence representing the targets field of the
            dataset. Can either be 1) a sequence of values containing as many
            elements as the number of contained patterns, or 2) the index
            of the sequence to use as the targets field. Defaults to 1, which
            means that the second sequence (usually containing the "y" values)
            will be used for the targets field.
        """
        if len(sequences) < 1:
            raise ValueError("At least one sequence must be passed")

        common_size = len(sequences[0])
        for seq in sequences:
            if len(seq) != common_size:
                raise ValueError(
                    "Sequences must contain the same " "amount of elements"
                )

        self._sequences = sequences
        if isinstance(targets, int):
            targets = sequences[targets]

        self.targets: Sequence[TTargetType] = targets

        Creates a ``SequenceDataset`` instance.

        Beware that the second sequence, will be used to fill the targets
        field without running any kind of type conversion.

        :param sequences: A sequence of sequences, Tensors or ndarrays
            representing the patterns.
        :param targets: A sequence representing the targets field of the
            dataset. Can either be 1) a sequence of values containing as many
            elements as the number of contained patterns, or 2) the index
            of the sequence to use as the targets field. Defaults to 1, which
            means that the second sequence (usually containing the "y" values)
            will be used for the targets field.
        
avalanche/benchmarks/utils/dataset_utils.py