MCPcopy
hub / github.com/huggingface/diffusers / require_torch

Function require_torch

tests/testing_utils.py:490–494  ·  view source on GitHub ↗

Decorator marking a test that requires PyTorch. These tests are skipped when PyTorch isn't installed.

(test_case)

Source from the content-addressed store, hash-verified

488
489
490def require_torch(test_case):
491 """
492 Decorator marking a test that requires PyTorch. These tests are skipped when PyTorch isn't installed.
493 """
494 return pytest.mark.skipif(not is_torch_available(), reason="test requires PyTorch")(test_case)
495
496
497def require_torch_2(test_case):

Callers

nothing calls this directly

Calls 1

is_torch_availableFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…