MCPcopy
hub / github.com/huggingface/transformers / require_torch_xpu

Function require_torch_xpu

src/transformers/testing_utils.py:1015–1021  ·  view source on GitHub ↗

Decorator marking a test that requires XPU (in PyTorch). These tests are skipped when XPU backend is not available.

(test_case)

Source from the content-addressed store, hash-verified

1013
1014
1015def require_torch_xpu(test_case):
1016 """
1017 Decorator marking a test that requires XPU (in PyTorch).
1018
1019 These tests are skipped when XPU backend is not available.
1020 """
1021 return unittest.skipUnless(is_torch_xpu_available(), "test requires XPU device")(test_case)
1022
1023
1024def require_non_xpu(test_case):

Callers

nothing calls this directly

Calls 1

is_torch_xpu_availableFunction · 0.85

Tested by

no test coverage detected