MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / require_torch

Function require_torch

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

237
238
239def require_torch(test_case):
240 """
241 Decorator marking a test that requires PyTorch. These tests are skipped when PyTorch isn't installed.
242 """
243 return unittest.skipUnless(is_torch_available(), "test requires PyTorch")(test_case)
244
245
246def require_torch_2(test_case):

Callers

nothing calls this directly

Calls 1

is_torch_availableFunction · 0.85

Tested by

no test coverage detected