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

Method __update_properties

python/interface/ltp/module.py:61–72  ·  view source on GitHub ↗
(
        self, device: Optional[torch.device] = None, dtype: Optional[torch.dtype] = None
    )

Source from the content-addressed store, hash-verified

59 return super().half()
60
61 def __update_properties(
62 self, device: Optional[torch.device] = None, dtype: Optional[torch.dtype] = None
63 ):
64 def apply_fn(module):
65 if not isinstance(module, BaseModule):
66 return
67 if device is not None:
68 module._device = device
69 if dtype is not None:
70 module._dtype = dtype
71
72 self.apply(apply_fn)

Callers 7

toMethod · 0.95
cudaMethod · 0.95
cpuMethod · 0.95
typeMethod · 0.95
floatMethod · 0.95
doubleMethod · 0.95
halfMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected