MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / require_torch

Function require_torch

src/diffusers/utils/testing_utils.py:201–205  ·  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

199
200
201def require_torch(test_case):
202 """
203 Decorator marking a test that requires PyTorch. These tests are skipped when PyTorch isn't installed.
204 """
205 return unittest.skipUnless(is_torch_available(), "test requires PyTorch")(test_case)
206
207
208def require_torch_2(test_case):

Callers

nothing calls this directly

Calls 1

is_torch_availableFunction · 0.85

Tested by

no test coverage detected