[Refactor] replace deprecated .value with [...] for nnx variables - #147
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello @lingebeng, 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 refactors the codebase to address deprecation warnings related to 'nnx.Variable' access. It systematically replaces all instances of the '.value' attribute with the recommended '[...]' indexing for 'nnx.Variable' objects, ensuring the code adheres to the current 'nnx' API standards. This change impacts several model architectures and their associated test files, improving code maintainability and preventing runtime warnings. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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
|
There was a problem hiding this comment.
Code Review
This pull request correctly replaces the deprecated nnx.Variable.value access with [...]. This resolves the deprecation warnings as intended. I've added a few suggestions to further improve the code by using the proxy features of nnx.Variable more idiomatically. For instance, instead of variable[...][slice], you can use variable[slice] directly, and similarly for attribute access like .shape or method calls like .at. These changes will make the code more concise and readable.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Hi @lingebeng. Thank you for opening a PR. We're planning to merge in an updated LLaDA soon. Could you remove those updates from the llada_8b folder? Also, could you address the comments from gemini-code-assist? Thanks! |
|
Of course |
0ccd6ba to
c732a33
Compare
Inspired by #135
Too many warnings!
nnx.Variable.value is deprecated (DeprecationWarning: '.value' access is now deprecated. For Variable[Array] instances use: variable[...] ...) -> replaced with x[...] in convnext (I haven't searched for other .value usages in the whole codebase)