mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-01 17:17:05 +00:00
[autoparallel] refactored shape consistency to remove redundancy (#1591)
* [autoparallel] refactored shape consistency to remove redundancy * polish code * polish code * polish code
This commit is contained in:
@@ -15,4 +15,7 @@ class SingletonMeta(type):
|
||||
if cls not in cls._instances:
|
||||
instance = super().__call__(*args, **kwargs)
|
||||
cls._instances[cls] = instance
|
||||
else:
|
||||
assert len(args) == 0 and len(
|
||||
kwargs) == 0, f'{cls.__name__} is a singleton class and a instance has been created.'
|
||||
return cls._instances[cls]
|
||||
|
Reference in New Issue
Block a user