noether.core.factory.utils¶
Attributes¶
Functions¶
|
Returns all names of kwargs in the constructor of a type (including the kwargs of all parent classes). |
|
Creates a callable that constructs an object from a classpath. This callable is either a |
Module Contents¶
- noether.core.factory.utils.logger¶
- noether.core.factory.utils.all_ctor_kwarg_names(cls)¶
Returns all names of kwargs in the constructor of a type (including the kwargs of all parent classes).
- noether.core.factory.utils.class_constructor_from_class_path(class_path)¶
Creates a callable that constructs an object from a classpath. This callable is either a
type(if no further kwargs are needed to be passed) or apartial()otherwise. This is equivalent to Hydra instantiation with_target_, which is also based on class paths.- Parameters:
class_path (str) – Fully specified module path of the object. For example:
"torch.optim.SGD"or"noether.core.callbacks.checkpoint.checkpoint.CheckpointCallback".- Returns:
A callable that constructs the object.
- Return type:
collections.abc.Callable[Ellipsis, Any]