You can define a function that performs the sequence of operations for CLAHE on a single image in NumPy array or Torch tensor format.  Then, write a Dataset class, and in your __getitem__ function call that function for CLAHE and pass the image tensor to do the job.