MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / __getattr__

Method __getattr__

tools/postprocess/torchvision_fix.py:54–64  ·  view source on GitHub ↗
(self, name)

Source from the content-addressed store, hash-verified

52 )
53
54 def __getattr__(self, name):
55 if hasattr(F, name):
56 return getattr(F, name)
57 try:
58 import torchvision.transforms.v2.functional as v2_F
59
60 if hasattr(v2_F, name):
61 return getattr(v2_F, name)
62 except ImportError:
63 pass
64 raise AttributeError(f"'{name}' not found in functional_tensor mock")
65
66 sys.modules["torchvision.transforms.functional_tensor"] = FunctionalTensorMock()
67 return True

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected