class documentation
class Config(BaseModelExtraForbid):
Configuration schema for an NN Archive.
| Class Method | validate |
Validate that the schema version uses major.minor format. |
| Method | __repr__ |
Undocumented |
| Method | __str__ |
Undocumented |
| Instance Variable | config |
Schema version in major.minor format. |
| Instance Variable | model |
Neural network configuration stored in the archive. |
@field_validator( 'config_version')
@classmethod
def validate_config_version_format(cls, v: @classmethod
str) -> str:
¶
Validate that the schema version uses major.minor format.
Examples
>>> Config.validate_config_version_format("1.0") '1.0' >>> Config.validate_config_version_format("1") Traceback (most recent call last): ... ValueError: 'config_version' must be in format 'x.y' where x and y are integers
| Parameters | |
v:str | Schema version string. |
| Returns | |
str | The validated schema version. |
| Raises | |
ValueError | If v is not in major.minor format, where both parts are integers. |