MCPcopy
hub / github.com/HIT-SCIR/ltp / cuda

Method cuda

python/interface/ltp/module.py:37–39  ·  view source on GitHub ↗
(self, device: Optional[int] = None)

Source from the content-addressed store, hash-verified

35 return super().to(*args, **kwargs)
36
37 def cuda(self, device: Optional[int] = None) -> Module:
38 self.__update_properties(device=torch.device("cuda", index=device))
39 return super().cuda(device=device)
40
41 def cpu(self) -> Module:
42 self.__update_properties(device=torch.device("cpu"))

Callers

nothing calls this directly

Calls 2

__update_propertiesMethod · 0.95
deviceMethod · 0.80

Tested by

no test coverage detected