Thanks @ptrblck for your swift response.
I am not sure if I am following, but I tried this :
    def __getitem__(self, idx):
        x = self.OpenAsArray(idx, invert=True)
        y = self.OpenMask(idx, add_dims=False)
        
        
        if self.transform is not None:
            x, y = self.transform((torch.from_numpy(x), torch.from_numpy(y)))
        
        
        return x,y

train_transforms=transforms.Compose([transforms.Resize(256),
                                    transforms.ToTensor()])
RGBdata = RGBCloudDataset(red_dir, blue_dir, green_dir, gt_dir, transform=train_transforms)

But still raises an error:
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-14-e310956eca45> in <module>
      3 RGBtest_loader  = DataLoader(RGBtest_dataset , batch_size=2, shuffle=True, num_workers=2)
      4 
----> 5 rgb_img, mask = next(iter(RGBtrain_loader))
      6 
      7 print('\n')

/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py in __next__(self)
    433         if self._sampler_iter is None:
    434             self._reset()
--> 435         data = self._next_data()
    436         self._num_yielded += 1
    437         if self._dataset_kind == _DatasetKind.Iterable and \

/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self)
   1083             else:
   1084                 del self._task_info[idx]
-> 1085                 return self._process_data(data)
   1086 
   1087     def _try_put_index(self):

/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py in _process_data(self, data)
   1109         self._try_put_index()
   1110         if isinstance(data, ExceptionWrapper):
-> 1111             data.reraise()
   1112         return data
   1113 

/opt/conda/lib/python3.7/site-packages/torch/_utils.py in reraise(self)
    426             # have message field
    427             raise self.exc_type(message=msg)
--> 428         raise self.exc_type(msg)
    429 
    430 

TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop
    data = fetcher.fetch(index)
  File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataset.py", line 272, in __getitem__
    return self.dataset[self.indices[idx]]
  File "<ipython-input-11-842d53b2f062>", line 65, in __getitem__
    x, y = self.transform((torch.from_numpy(x), torch.from_numpy(y)))
  File "/opt/conda/lib/python3.7/site-packages/torchvision/transforms/transforms.py", line 67, in __call__
    img = t(img)
  File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/opt/conda/lib/python3.7/site-packages/torchvision/transforms/transforms.py", line 267, in forward
    return F.resize(img, self.size, self.interpolation)
  File "/opt/conda/lib/python3.7/site-packages/torchvision/transforms/functional.py", line 310, in resize
    return F_pil.resize(img, size=size, interpolation=interpolation)
  File "/opt/conda/lib/python3.7/site-packages/torchvision/transforms/functional_pil.py", line 410, in resize
    raise TypeError('img should be PIL Image. Got {}'.format(type(img)))
TypeError: img should be PIL Image. Got <class 'tuple'>
type or paste code here