Conversation
HangenYuu
left a comment
There was a problem hiding this comment.
These are the current parameters to pytensor.function():
inputs: Iterable[Variable]outputs: Variable | Iterable[Variable] | dict[str, Variable] | None = Nonemode: str | Mode | None = Noneupdates: Iterable[tuple[Variable, Variable]] | dict[Variable, Variable] | None = Nonegivens: Iterable[tuple[Variable, Variable]] | dict[Variable, Variable] | None = Noneno_default_updates: bool = Falseaccept_inplace: bool = Falsename: str | None = Nonerebuild_strict: bool = Trueallow_input_downcast: bool | None = Noneprofile: bool | ProfileStats | None = Noneon_unused_input: str | None = None
The ones I propose to remove and use a default value are
accept_inplace:FalseNo inplace ops by default.rebuild_strict:Trueby default.allow_input_downcast:Noneby default.profile:Noneby default.on_unused_input:Noneby default.
I also want to ask about givens and no_default_updates since I have never used them before (givens seem unremoveable though).
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 |
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 |
HangenYuu
left a comment
There was a problem hiding this comment.
Also, I realized 2 things that output_keys will create output_subset behind the scene. So removing output_subset means that I also need to remove output_keys, together with the tests testing for them e.g., test_partial_function_with_output_keys. Is this okay?
Sounds okay |
Description
Simplify the function class in pytensor.
output_subsetkwargs at call time of classFunctionas no one is using it.pytensor.function()parameters (use default value in codes instead)Related Issue
Checklist
Type of change