To access the dataset from the databunch data, one needs to do data.train_dl.dl.dataset.
The type of the dataset is LabelList which is a subclass of torch.utils.data.dataset.Dataset created by fastai in data_block.py
My databunch is created by doing
data = TensorImageList.from_folder('./data_test/', extensions='.ti').split_by_rand_pct().label_from_folder().databunch(bs=8, num_workers=0)
The __getitems__ method of the LabelList is the following :
def __getitem__(self,idxs:Union[int,np.ndarray])->'LabelList':
        idxs = try_int(idxs)
        if isinstance(idxs, Integral):
            if self.item is None: x,y = self.x[idxs],self.y[idxs]
            else:                 x,y = self.item   ,0
            if self.tfms or self.tfmargs:
                x = x.apply_tfms(self.tfms, **self.tfmargs)
            if hasattr(self, 'tfms_y') and self.tfm_y and self.item is None:
                y = y.apply_tfms(self.tfms_y, **{**self.tfmargs_y, 'do_resolve':False})
            if y is None: y=0
            return x,y
        else: return self.new(self.x[idxs], self.y[idxs])

So basically, it calls the __getitem__ method of self.x which in my case is a TensorImageList, the
__getitem__ method is the following
def __getitem__(self,idxs:int)->Any:
        idxs = try_int(idxs)
        if isinstance(idxs, Integral): return self.get(idxs)
        else: return self.new(self.items[idxs], inner_df=index_row(self.inner_df, idxs))

It calls self.get which is the following :
def get(self, i):
        fn = super().get(i)
        res = self.open(fn)
        self.sizes[i] = res.size
        return res

And at this point the open is exactly what I overrided.