def filter_indices_by_size(self, indices, max_positions):
        """
        Filter each sub-dataset independently, then update the round robin to work
        on the filtered sub-datasets.
        """
        if not hasattr(self, "max_positions"):
            self.max_positions = max_positions
        ignored_some = False
        for i in range(len(self.datasets)):
            # ignored = []
            self._ordered_indices[i], ignored = self.datasets[i].filter_indices_by_size(
                self._ordered_indices[i], self.max_positions[i]
            )
            if len(ignored) > 0:
                ignored_some = True
                logger.warning(
                    f"{len(ignored)} samples from {i} have invalid sizes and will be skipped, "
                    f"max_positions={self.max_positions[i]}, first few sample ids={ignored[:10]}"
                )

        logger.info('update dataset size')
        self._update_size()

        # Since we are modifying in place the _ordered_indices,
        # it's not possible anymore to return valid ignored indices.
        # Hopefully the extra debug information print above should be enough to debug.
        # Ideally we would receive ignore_invalid_inputs so that we could have
        # a proper error message.
        return (np.arange(len(self)), [0] if ignored_some else [])

        Filter each sub-dataset independently, then update the round robin to work
        on the filtered sub-datasets.
        
speecht5/speecht5/data/multitask_dataset.py