- 
                Notifications
    You must be signed in to change notification settings 
- Fork 19.6k
Fix bug with correlate for tensorflow #21778
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
base: master
Are you sure you want to change the base?
Fix bug with correlate for tensorflow #21778
Conversation
| Summary of ChangesHello @danielenricocahall, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a bug in the  Highlights
 Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either  
 Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a  Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
 | 
correlateThere 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.
Code Review
This pull request fixes a bug in the correlate function for "full" and "same" modes. The logic for both modes has been corrected, and a new unit test has been added to verify the fix using data from the original issue. The changes look correct and the test is a good addition. I've added one suggestion to improve the code structure and robustness by using an if/elif/else block and adding explicit validation for the mode parameter, which aligns with the Keras API design guidelines on error handling.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
| Codecov Report❌ Patch coverage is  
 Additional details and impacted files@@            Coverage Diff             @@
##           master   #21778      +/-   ##
==========================================
- Coverage   82.69%   82.63%   -0.06%     
==========================================
  Files         573      577       +4     
  Lines       58888    59425     +537     
  Branches     9218     9315      +97     
==========================================
+ Hits        48696    49107     +411     
- Misses       7845     7913      +68     
- Partials     2347     2405      +58     
 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
 | 
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.
LGTM, thanks for the fix
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.
Thank you for fixing this! This was a tricky one.
| Hey @hertschuh thank you for the feedback! I think I've addressed all comments - to confirm, for  | 
| 
 Yes, exactly! | 
Addresses #21617 by ensuring the "full" and "same" case are properly handled. For simplicity, "same" just reuses "full" and truncates. To validate, a unit test has been added which uses the original data from the issue.