def __getitem__(self, index: int):
        """
        Args:
            index (int): Index

        Returns:
            tuple: (image, target) where target is index of the target class.
        """
        img = self.data[index].float().unsqueeze(0) / 255.0
        target = int(self.targets[index])

        if self.transform is not None:
            img = self.transform(img)

        if self.target_transform is not None:
            target = self.target_transform(target)

        return img, target

        Args:
            index (int): Index

        Returns:
            tuple: (image, target) where target is index of the target class.
        
avalanche/benchmarks/datasets/external_datasets/mnist.py