-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Carefully move some internal methods of recurrent.py to a dedicated utils file #178
base: v2
Are you sure you want to change the base?
Carefully move some internal methods of recurrent.py to a dedicated utils file #178
Conversation
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@googlebot I fixed it. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
1 similar comment
@googlebot I consent. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Sorry for the mess with the commit authors, a bit an unexpected issue but seems to be solved :) |
Thanks for the PR, Sergey! I understand your concerns regarding the size of
I don't think we have any refactoring planned atm. Most TODOs are there to provide context or serve as a reminder, but none are critical to implement/fix. |
Thank you @superbobry ! The selection of It has the highest change frequency and the biggest size. So the major reason to think of refactoring this file not just the size, but the frequency of changes/fixes. (Because we commit when we need to fix or modify something ) Zooming a bit deeper the analysis identified that there is quite a high chances that And when I was trying to reproduce the example from #161 something was failing in Intuitively, these two methods are actual targets of my refactoring. My intuitive plan was:
But seems like I completely formulated this plan only now :) The idea of this refactoring is to extract
Of course, this refactoring idea is based only on numbers without knowing the details of your challenges :) So if you think the extraction of How do you think? |
Before trying to tackle #161 I thought it can be helpful to a bit simplify navigation in
recurrent.py
by reducing the number of lines of code there.Carefully extracting few internal methods to another file seemed to be a quick win in that sense. So I decided to come up with this PR. Hopefully, it is useful for the maintainability of
recurrent.py
.Changes
recurrent.py
to a new filerecurrent_internals.py
:recurrent_internals.py
as a dependency to the Bazelsrc/BUILD
The tests are passing locally
Questions
It was quite a useful journey for me and it would be great if you find the outcome useful as well:) I've also got a few questions while implementing the changes.
recurrent_internals.py
a good enough name? Please feel free to suggest a nicer or more consistent one.recurrent.py
. Maybe you have some refactoring plans or ideas for this file which should be considered in the current or next PRs?