Thank you for your response. The workaround works for now but I am getting a new error at the line:
p.map(workers.run(used_device), [i for i in range(0,3)])
    642             return self._value
    643         else:
--> 644             raise self._value
    645 
    646     def _set(self, i, obj):

TypeError: 'NoneType' object is not callable

Here is the code snippet from the python file
import torch
import numpy
from torch.utils.data import Dataset, DataLoader
import pdb

class data(Dataset):
    # Constructor
    def __init__(self, x, y):
        self.x = x
        self.y = y
        self.len = self.x.shape[0]

    # Getter
    def __getitem__(self, idx):
        return self.x[idx], self.y[idx]

    # Return the length
    def __len__(self):
        return self.len

def run(device):
    x = numpy.random.rand(1700,402)
    y = numpy.random.rand(1700)
    dataset = data(torch.Tensor(x),torch.Tensor(y))
    print('the length of the dataset = ', len(dataset))
    data_loader = DataLoader(dataset, batch_size = 100, shuffle = True)
    
    for idxs, (xx, yy) in enumerate(data_loader):
        xx, yy = xx.to(device), yy.to(device)
        print ('idx: {} x: {} y: {}'.format(idxs, xx, yy))

this is the code snippet from the Jupiter notebook:
from multiprocessing import Pool
import workers
    
if __name__ == "__main__": 
    used_device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
    num_processors = 2
    p=Pool(processes = num_processors)
    p.map(workers.run(used_device), [i for i in range(0,3)]) 

Can you tell me where the error comes from?