class ArchRegistry: (source)
A registry of architectures.
Architectures are detected/loaded in insertion order unless before
is specified.
Method | __contains__ |
Undocumented |
Method | __getitem__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __iter__ |
Returns an iterator over all architectures in insertion order. |
Method | __len__ |
Undocumented |
Method | add |
Adds the given architectures to the registry. |
Method | architectures |
Returns a new list with all architectures in the registry. |
Method | copy |
Returns a copy of the registry. |
Method | get |
Undocumented |
Method | load |
Detects the architecture of the given state dict and loads it. |
Static Method | _get |
Undocumented |
Instance Variable | _architectures |
Undocumented |
Instance Variable | _by |
Undocumented |
Instance Variable | _ordered |
Undocumented |
ArchSupport
, ignore_duplicates: bool
= False) -> list[ ArchSupport]
:
(source)
¶
Adds the given architectures to the registry.
Throws an error if an architecture with the same ID already exists,
unless ignore_duplicates
is True, in which case the old architecture is retained.
Throws an error if a circular dependency of before
references is detected.
If an error is thrown, the registry is left unchanged.
Returns a list of architectures that were added.
Literal[ 'insertion', 'detection']
= 'insertion') -> list[ ArchSupport]
:
(source)
¶
Returns a new list with all architectures in the registry.
The order of architectures in the list is either insertion order or the order in which architectures are detected.
Detects the architecture of the given state dict and loads it.
This will canonicalize the state dict if it isn't already.
Throws an UnsupportedModelError
if the model architecture is not supported.