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

Add reduced_space option for PyTorchModel predictor #76

Merged
merged 3 commits into from
Aug 15, 2024

Conversation

Robbybp
Copy link
Collaborator

@Robbybp Robbybp commented Aug 14, 2024

I've tested locally...

@odow
Copy link
Collaborator

odow commented Aug 14, 2024

This option needs to be added to the docstring, and we need a test 😄

But I can do it later if you don't have time.

# If config maps to a ReducedSpace predictor, we'll get a MethodError
# when trying to add the nested redcued space predictors.
# TODO: raise a nicer error or try to handle this gracefully.
inner_predictor = MathOptAI.ReducedSpace(inner_predictor)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wondered about adding ReducedSpace(predictor::ReducedSpace) = predictor, but I want to avoid magic where possible.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't seem horrible to me, but probably best to at least wait until it comes up in a real workflow we want to support.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I don't think I had any tests for the PyTorch stuff because I didn't have CI set up yet.

@Robbybp
Copy link
Collaborator Author

Robbybp commented Aug 14, 2024

I can update the docstring and add a test.

@odow odow merged commit fea7a92 into main Aug 15, 2024
@odow odow deleted the rp/pytorch-reducedspace branch August 15, 2024 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants