mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-05 11:02:05 +00:00
[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:
@@ -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:
|
||||
|
Reference in New Issue
Block a user