-
Notifications
You must be signed in to change notification settings - Fork 108
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
Simplify the Function class #955
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the current parameters to pytensor.function()
:
inputs: Iterable[Variable]
outputs: Variable | Iterable[Variable] | dict[str, Variable] | None = None
mode: str | Mode | None = None
updates: Iterable[tuple[Variable, Variable]] | dict[Variable, Variable] | None = None
givens: Iterable[tuple[Variable, Variable]] | dict[Variable, Variable] | None = None
no_default_updates: bool = False
accept_inplace: bool = False
name: str | None = None
rebuild_strict: bool = True
allow_input_downcast: bool | None = None
profile: bool | ProfileStats | None = None
on_unused_input: str | None = None
The ones I propose to remove and use a default value are
accept_inplace
:False
No inplace ops by default.rebuild_strict
:True
by default.allow_input_downcast
:None
by default.profile
:None
by default.on_unused_input
:None
by 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_subset
kwargs at call time of classFunction
as no one is using it.pytensor.function()
parameters (use default value in codes instead)Related Issue
Checklist
Type of change