We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4ea637 commit 9c8cc41Copy full SHA for 9c8cc41
utensor_cgen/backend/api.py
@@ -19,6 +19,8 @@ def register(cls, backend_cls):
19
raise TypeError(
20
'can only register subclass of %s: get %s' % (Backend, backend_cls)
21
)
22
+ if backend_cls.TARGET in cls.BACKENDS:
23
+ raise ValueError('duplicate TARGET detected: %s' % backend_cls.TARGET)
24
cls.BACKENDS[backend_cls.TARGET] = backend_cls
25
return backend_cls
26
0 commit comments