By default pytorch will use multiple cpu cores to calculate:

import time
import multiprocessing as mp
import torch as t

def subproc():
    # keep process showing in "top"
    begin = time.time()
    while time.time() - begin < 10:
        a = t.ones([1000, 1000]) * t.ones([1000, 1000])


if __name__ == "__main__":
    p = mp.Process(target=subproc, args=())
    p2 = mp.Process(target=subproc, args=())
    p.start()
    p2.start()
    print("started")

    p.join()
    p2.join()
    print("joined")

Seems that you are using “threads”, not good for python, you must use processes:
results = Parallel(n_jobs=num_cpu, prefer="threads")(delayed(test_img)(network_lst[i], dataset) for i in range(N))