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

Method to

python/interface/ltp/module.py:32–35  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

30 raise RuntimeError("Cannot set the device explicitly. Please use module.to(new_device).")
31
32 def to(self, *args, **kwargs) -> Module:
33 out = torch._C._nn._parse_to(*args, **kwargs)
34 self.__update_properties(device=out[0], dtype=out[1])
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))

Callers 4

pipelineMethod · 0.80
_from_pretrainedMethod · 0.80
forwardMethod · 0.80
eisnerFunction · 0.80

Calls 1

__update_propertiesMethod · 0.95

Tested by

no test coverage detected