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

Method _sync_if_cuda

lightx2v/utils/async_vae.py:104–110  ·  view source on GitHub ↗
(self, args: tuple[Any, ...])

Source from the content-addressed store, hash-verified

102 return self._stream
103
104 def _sync_if_cuda(self, args: tuple[Any, ...]) -> None:
105 if not torch.cuda.is_available():
106 return
107 device = self._resolve_device(args)
108 if device.type != "cuda":
109 return
110 torch.cuda.synchronize(device)
111
112 def submit(self, decode_fn: Callable[..., torch.Tensor], *args: Any, **kwargs: Any) -> None:
113 self._num_submitted += 1

Callers 1

submitMethod · 0.95

Calls 2

_resolve_deviceMethod · 0.95
is_availableMethod · 0.45

Tested by

no test coverage detected