[tensor] added linear implementation for the new sharding spec (#1416)

* [tensor] added linear implementation for the new sharding spec

* polish code
This commit is contained in:
Frank Lee
2022-08-12 11:33:09 +08:00
committed by GitHub
parent d40a9392ba
commit ae1b58cd16
3 changed files with 316 additions and 7 deletions

View File

@@ -17,12 +17,7 @@ class _DimSpec:
self.shard_list = shard_list
def __eq__(self, other):
if dir(self) != dir(other):
return False
for attr in dir(self):
if not attr.startswith('__') and getattr(self, attr) != getattr(other, attr):
return False
return True
return str(self) == str(other)
def __repr__(self):
if self.is_replica: