[ColoTensor] improves init functions. (#1150)

This commit is contained in:
Jiarui Fang
2022-06-21 18:28:38 +08:00
committed by GitHub
parent 8106d7b8c7
commit 8cdce0399c
5 changed files with 103 additions and 40 deletions

View File

@@ -35,7 +35,7 @@ class ColoParameter(ColoTensor, torch.nn.Parameter):
data: Optional[torch.Tensor] = None,
requires_grad: bool = True,
spec: TensorSpec = TensorSpec(distspec.replicate())) -> None:
self._spec = copy(spec)
self._tensor_spec = copy(spec)
self._type = TensorType.MODEL
self._graph_node = None