pymc-devs / pymc-devs/pytensor
Add support for multiple output functions to `gradient.verify_grad`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 644
- Forks
- 208
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 16
Description
Description
This is marked as a to-do in the code, along with a suggestion of how to handle it.
The whole function could probably be cleaned up while we're at it. It's not easy to read because it's doing so much all in a single function. It would be better to split up the construction of the tests from their execution. This would make extending to multiple outputs very straightforward -- just add one more outer loop.
I don't know how we feel about another dependency, but farming out the actual numerical gradients to a specialized package like numdifftools might be good too.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pytensor/gradient.py at the verify_grad TODO around line 1791 and read the existing function. Separate test construction from execution as suggested, then extend the behavior so multiple output functions are verified; the optional numdifftools dependency is an open design question.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100