pymc-devs / pymc-devs/pytensor

CDataTypeConstant.signature() is wrong, merge_signature override shouldn't be needed

Open Beginner friendly
#2,031 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
644
Forks
208
Avg merge
2d 14h
Merged PRs (30d)
16

Description

CDataTypeConstant has an inconsistency between signature() and merge_signature():

https://github.com/pymc-devs/pytensor/blob/6d7fa2fa350b6c1a372e7af4701a715cf6b26514/pytensor/link/c/type.py#L288-L297

Why can't signature() be (self.type, id(self.data)), which would make the merge_signature() override unnecessary.

https://github.com/pymc-devs/pytensor/blob/6d7fa2fa350b6c1a372e7af4701a715cf6b26514/pytensor/graph/basic.py#L694-L695

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CDataTypeConstant implementation in pytensor/link/c/type.py and compare its signature() with merge_signature(). Read the related signature handling in pytensor/graph/basic.py. Done means the two paths are consistent without the unnecessary override, with the relevant test suite still passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.