pytensor icon indicating copy to clipboard operation
pytensor copied to clipboard

Simplify the Function class

Open HangenYuu opened this issue 1 year ago • 5 comments

Description

Simplify the function class in pytensor.

  • [x] Remove the output_subset kwargs at call time of class Function as 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

Type of change

  • [ ] New feature / enhancement
  • [ ] Bug fix
  • [ ] Documentation
  • [x] Maintenance
  • [ ] Other (please specify):

HangenYuu avatar Jul 25 '24 01:07 HangenYuu

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

ricardoV94 avatar Jul 25 '24 07:07 ricardoV94

Some things we could probably remove because nobody uses them:

  1. Default values for function argument

Oh wait, then what did you mean here in #552 🫤

HangenYuu avatar Jul 25 '24 10:07 HangenYuu

Some things we could probably remove because nobody uses them:

  1. 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

ricardoV94 avatar Jul 25 '24 10:07 ricardoV94

Some things we could probably remove because nobody uses them:

  1. 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?

HangenYuu avatar Jul 26 '24 06:07 HangenYuu

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

ricardoV94 avatar Jul 26 '24 14:07 ricardoV94