Method
__update_properties
(
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) |
Tested by
no test coverage detected