def paramsDict2cpu(paramsDict):
    """Returns a copy of paramsDict with all elements on CPU."""
    cpuDict = {}
    for key, val in paramsDict.items():
        cpuDict[key] = val.to('cpu')
    return cpuDict