Skip to content

Changed enum parsing mechanism to be name based + bug fixes

Compare
Choose a tag to compare
@eladrich eladrich released this 10 Feb 22:54
· 17 commits to master since this release

Changed enum parsing to be based on enum field names instead of values.

As discussed in #8 , this allows one to support enums with non-string values such as

class LRMethod1(Enum):
    onecycle: torch.optim.lr_scheduler = OneCycleLR
    lambdalr: torch.optim.lr_scheduler = LambdaLR

Instead of allowing only enums of the form:

class LRMethod2(Enum):
    onecycle: str = "onecycle"
    constant: str = "constant"

The release also includes:

  • Minor improvement in error mechanism
  • Bug fixes when using the default collections such as Dict and List