MCPcopy Create free account
hub / github.com/dmlc/xgboost / test_context_is_removed

Method test_context_is_removed

tests/python-gpu/load_pickle.py:31–37  ·  view source on GitHub ↗

Under invalid CUDA_VISIBLE_DEVICES, context should reset

(self)

Source from the content-addressed store, hash-verified

29 assert len(res) == 10
30
31 def test_context_is_removed(self) -> None:
32 """Under invalid CUDA_VISIBLE_DEVICES, context should reset"""
33 assert os.environ["CUDA_VISIBLE_DEVICES"] == "-1"
34 bst = load_pickle(model_path)
35 config = bst.save_config()
36 config = json.loads(config)
37 assert config["learner"]["generic_param"]["device"] == "cpu"
38
39 def test_context_is_preserved(self) -> None:
40 """Test the device context is preserved after pickling."""

Callers

nothing calls this directly

Calls 2

load_pickleFunction · 0.90
save_configMethod · 0.80

Tested by

no test coverage detected