def paramsDictDetach(paramsDict):
    """Returns a copy of paramsDict with all elements detached."""
    detachedDict = {}
    for key, val in paramsDict.items():
        detachedDict[key] = val.detach()
    return detachedDict