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

Function require_torch_npu

src/transformers/testing_utils.py:988–992  ·  view source on GitHub ↗

Decorator marking a test that requires NPU (in PyTorch).

(test_case)

Source from the content-addressed store, hash-verified

986
987
988def require_torch_npu(test_case):
989 """
990 Decorator marking a test that requires NPU (in PyTorch).
991 """
992 return unittest.skipUnless(is_torch_npu_available(), "test requires PyTorch NPU")(test_case)
993
994
995def require_torch_multi_npu(test_case):

Callers

nothing calls this directly

Calls 1

is_torch_npu_availableFunction · 0.85

Tested by

no test coverage detected