Simplify the Function class
Description
Simplify the function class in pytensor.
- [x] Remove the
output_subsetkwargs at call time of classFunctionas no one is using it. - [ ] Check and Remove unused
pytensor.function()parameters (use default value in codes instead) - [ ] Expose trust_input as a parameter.
Related Issue
- [x] Closes #552
- [ ] Related to #
Checklist
- [x] Checked that the pre-commit linting/style checks pass
- [x] Included tests that prove the fix is effective or that the new feature works
- [x] Added necessary documentation (docstrings and/or example notebooks)
- [ ] If you are a pro: each commit corresponds to a relevant logical change
Type of change
- [ ] New feature / enhancement
- [ ] Bug fix
- [ ] Documentation
- [x] Maintenance
- [ ] Other (please specify):
The ones I propose to remove and use a default value are
Those are all still useful, unfortunately.
There's a getattr in call that we can remove according to the comment about being there for old pickles
Some things we could probably remove because nobody uses them:
- Default values for function argument
Oh wait, then what did you mean here in #552 🫤
Some things we could probably remove because nobody uses them:
- Default values for function argument
Oh wait, then what did you mean here in #552 🫤
https://pytensor.readthedocs.io/en/latest/library/compile/io.html#value-initial-and-default-values
Some things we could probably remove because nobody uses them:
- Default values for function argument
Oh wait, then what did you mean here in #552 🫤
https://pytensor.readthedocs.io/en/latest/library/compile/io.html#value-initial-and-default-values
Oh so you meant to remove value parameter from the pytensor.compile.io.In?
Also, I realized 2 things that
output_keyswill createoutput_subsetbehind the scene. So removingoutput_subsetmeans that I also need to removeoutput_keys, together with the tests testing for them e.g.,test_partial_function_with_output_keys. Is this okay?
Sounds okay