[doc] fix some typos and add xpu to the testing documentation (#29894)

fix typo
This commit is contained in:
Fanli Lin
2024-03-28 17:42:49 +08:00
committed by GitHub
parent 22d159ddf9
commit 7c19fafe44
2 changed files with 11 additions and 12 deletions

View File

@@ -792,13 +792,13 @@ def require_torch_xpu(test_case):
def require_torch_multi_xpu(test_case):
"""
Decorator marking a test that requires a multi-XPU setup with IPEX and atleast one XPU device. These tests are
Decorator marking a test that requires a multi-XPU setup with IPEX and at least one XPU device. These tests are
skipped on a machine without IPEX or multiple XPUs.
To run *only* the multi_xpu tests, assuming all test names contain multi_xpu: $ pytest -sv ./tests -k "multi_xpu"
"""
if not is_torch_xpu_available():
return unittest.skip("test requires IPEX and atleast one XPU device")(test_case)
return unittest.skip("test requires IPEX and at least one XPU device")(test_case)
return unittest.skipUnless(torch.xpu.device_count() > 1, "test requires multiple XPUs")(test_case)