Hey!
Sorry for the delay to reply.
I imported from skimage:
from skimage.color import rgb2lab
And then I executed the follow code:
img_lab = rgb2lab(img_resize)
I executed the following code with some prints:
# Making and Configuring the dataset

class CustomDataset(Dataset):
    """Custom Dataset."""

    def __init__(self, root_dir, transform=None):
        """
        Args:
            root_dir (string): Directory with all the images.
            transform (callable, optional): Optional transform to be applied
                on a sample.
        """
        self.root_dir = root_dir
        self.transform = transform
        self.file_list=os.listdir(root_dir)

    def __len__(self):
        return len(self.file_list)

    def __getitem__(self, idx):
        img = Image.open(self.root_dir+'/'+self.file_list[idx])
        if self.transform is not None:
          img_original = self.transform(img)
          print("img_original = self.transform(img)",type(img_original))

          img_resize = transforms.Resize((128,128),2)(img_original)
          print("img_resize = transforms.Resize((128,128),2)(img_original)",type(img_resize))

          img_original = np.asarray(img_original)
          
          img_lab = rgb2lab(img_resize)
          print("img_lab = rgb2lab(img_resize)",img_lab.dtype)

          img_l = img_lab[:,:,0]-50.
          print("img_l = img_lab[:,:,0]-50.",img_l.dtype)
          img_l = np.asarray(img_l, dtype=np.float32)
          print("img_l = np.asarray(img_l, dtype=np.float32)",img_l.dtype)
          
          
          img_ab = img_lab[:, :, 1:3]
          print("img_ab = img_lab[:, :, 1:3]",img_ab.dtype)
          img_ab = np.asarray(img_ab, dtype=np.float32)
          print("img_ab = np.asarray(img_ab, dtype=np.float32)",img_ab.dtype)
          
          img_l = torch.from_numpy(img_l)
          print("img_l = torch.from_numpy(img_l)",img_l.dtype)
          img_ab = torch.from_numpy(img_ab.transpose((2, 0, 1)))
          print("img_ab = torch.from_numpy(img_ab.transpose((2, 0, 1)))",img_ab.dtype)

          print(img_l.shape)
          print(img_ab.shape)
        
          return img_l, img_ab

The information of dtypes are as shown below:
img_original = self.transform(img) <class 'PIL.Image.Image'>
img_resize = transforms.Resize((128,128),2)(img_original) <class 'PIL.Image.Image'>
img_lab = rgb2lab(img_resize) float64
img_l = img_lab[:,:,0]-50. float64
img_l = np.asarray(img_l, dtype=np.float32) float32
img_ab = img_lab[:, :, 1:3] float64
img_ab = np.asarray(img_ab, dtype=np.float32) float32
img_l = torch.from_numpy(img_l) torch.float32
img_ab = torch.from_numpy(img_ab.transpose((2, 0, 1))) torch.float32

Best regards,
Matheus Santos