quantlab.model.predefined.xgb.boosters_on_cpu#
- quantlab.model.predefined.xgb.boosters_on_cpu(boosters, device)[source]#
Put
boostersondevice="cpu"for the block, then back ondevice.Used to write a checkpoint that loads on a machine without CUDA while the Boosters in memory keep their device.
device=Noneleaves them on the CPU.Examples
>>> with boosters_on_cpu([booster], "cuda"): ... joblib.dump(booster, "model.joblib")