Skip to content
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

change _compute_metrics not to modify callers version #645

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

misko
Copy link
Collaborator

@misko misko commented Apr 8, 2024

Currently the function _compute_metrics() takes as input a dictionary (out) that contains tensors as values. These values are modified inside of _compute_metrics() , which means the callers version of these tensors are also modified.

out=forward(batch)
_compute_metrics(out)
out # no longer the same values as from forward(batch)

@misko misko requested a review from mshuaibii April 8, 2024 20:35
Copy link

codecov bot commented Apr 8, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 57.27%. Comparing base (ed82408) to head (c23328a).

Files Patch % Lines
ocpmodels/trainers/ocp_trainer.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #645      +/-   ##
==========================================
- Coverage   57.28%   57.27%   -0.01%     
==========================================
  Files         109      109              
  Lines       10315    10316       +1     
==========================================
  Hits         5909     5909              
- Misses       4406     4407       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mshuaibii mshuaibii added this pull request to the merge queue Apr 8, 2024
Merged via the queue into main with commit 0c03874 Apr 8, 2024
5 checks passed
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.

2 participants