This error is here because:
X = torch.DoubleTensor(X)

def X_power_func(j):
    X_power = X.cuda()**j
    return X_power

You are referencing a global variable here, since “fork” will map the memory of forker to forkee, you can
pass this function to subprocesses correctly, however, “fork” is not compatible with cuda, and therefore the error is thrown.
Could you please show the full code of your estimator? Writing parallel programs in python could be a real pain, with your full code we can choose the most efficient and simplest solution.