mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-06-24 14:33:20 +00:00
fix colo init context (#1026)
This commit is contained in:
parent
58a7dd2ede
commit
007ca0df92
@ -69,7 +69,7 @@ def _setattr_with_colotensor(self, name: str, value: Union[torch.Tensor, torch.n
|
||||
d.discard(name)
|
||||
|
||||
params = self.__dict__.get('_parameters')
|
||||
if isinstance(value, (ColoTensor, torch.nn.Parameter)):
|
||||
if isinstance(value, (ColoParameter, torch.nn.Parameter)):
|
||||
if params is None:
|
||||
raise AttributeError("cannot assign parameters before Module.__init__() call")
|
||||
remove_from(self.__dict__, self._buffers, self._modules, self._non_persistent_buffers_set)
|
||||
|
Loading…
Reference in New Issue
Block a user