[Graph] building computing graph with ColoTensor, Linear only (#917)

This commit is contained in:
Jiarui Fang
2022-05-07 17:10:37 +08:00
committed by GitHub
parent 75d221918a
commit 845856ea29
6 changed files with 202 additions and 9 deletions

View File

@@ -38,6 +38,7 @@ class ColoTensor(object):
self._shard_spec = shard_spec
self._shard_pattern = ShardPattern.NA
self._type = TensorType.NONMODEL
self._graph_node = None
def __getitem__(self, key):
return ColoTensor.init_from_torch_tensor(self.torch_tensor()[key])