Skip to content

Security: Dead code in read function - unused return value#311

Open
tuanaiseo wants to merge 1 commit into
google-deepmind:v2from
tuanaiseo:contribai/fix/security/dead-code-in-read-function-unused-return
Open

Security: Dead code in read function - unused return value#311
tuanaiseo wants to merge 1 commit into
google-deepmind:v2from
tuanaiseo:contribai/fix/security/dead-code-in-read-function-unused-return

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

In sonnet/src/nets/dnc/read.py, the squash_op(weights) call on line 36 has its return value discarded. The function is called for its side effect but the squashed result is never used, meaning the squash_before_access parameter has no effect.

Severity: low
File: sonnet/src/nets/dnc/read.py

Solution

Either use the return value: weights = squash_op(weights), or remove the parameter if squashing before access is not needed.

Changes

  • sonnet/src/nets/dnc/read.py (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

In sonnet/src/nets/dnc/read.py, the squash_op(weights) call on line 36 has its return value discarded. The function is called for its side effect but the squashed result is never used, meaning the squash_before_access parameter has no effect.

Affected files: read.py

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 6, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant