[tensor] refactor parallel action (#1007)

* refactor parallel action

* polish unit tests
This commit is contained in:
ver217
2022-05-20 20:19:58 +08:00
committed by GitHub
parent 9e3d602dba
commit a3b66f6def
12 changed files with 45 additions and 77 deletions

View File

@@ -45,7 +45,7 @@ class ColoTensor(torch.Tensor):
self._spec = spec
def has_spec(self) -> bool:
return self._spec.num_action > 0
return self._spec.parallel_action is not None
def is_model_data(self) -> bool:
return self._type == TensorType.MODEL