Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed enum parsing mechanism to be name based #9

Merged
merged 2 commits into from
Feb 10, 2022
Merged

Conversation

eladrich
Copy link
Owner

@eladrich eladrich commented Feb 9, 2022

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"

@eladrich eladrich added the enhancement New feature or request label Feb 9, 2022
@eladrich eladrich merged commit 25fdce1 into master Feb 10, 2022
@eladrich eladrich deleted the feat/enum branch February 10, 2022 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant