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

[Fix] method always using cuda #2715

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

hiramf
Copy link

@hiramf hiramf commented Mar 25, 2024

Motivation

single_level_grid_priors has a arg to specify device, which defaults to 'cuda'. this PR fixes the function to allow using cpu.

Modification

pass in the value of mask_feat.device to the method instead of converting the tensor afterwards.

BC-breaking (Optional)

no breaking changes

Use cases (Optional)

no new features

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
  3. If the modification has a dependency on downstream projects of a newer version, this PR should be tested with all supported versions of downstream projects.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

function has a arg for device which defaults to 'cuda'
@CLAassistant
Copy link

CLAassistant commented Mar 25, 2024

CLA assistant check
All committers have signed the CLA.

@hiramf hiramf closed this Mar 25, 2024
@hiramf hiramf deleted the patch-1 branch March 25, 2024 19:13
@hiramf hiramf restored the patch-1 branch March 25, 2024 19:15
@hiramf hiramf reopened this Mar 25, 2024
@hiramf hiramf changed the title fix method always using cuda [Fix] method always using cuda Mar 25, 2024
@hiramf
Copy link
Author

hiramf commented Mar 27, 2024

@RunningLeon would appreciate your review

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.38%. Comparing base (bc75c9d) to head (5f283be).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2715   +/-   ##
=======================================
  Coverage   48.38%   48.38%           
=======================================
  Files         357      357           
  Lines       13850    13850           
  Branches     2046     2046           
=======================================
  Hits         6702     6702           
  Misses       6693     6693           
  Partials      455      455           
Flag Coverage Δ
unittests 48.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@henryrobbins
Copy link

I ran into this issue and this patch fixed it for me as well!

henryrobbins added a commit to henryrobbins/mmdeploy that referenced this pull request Dec 10, 2024
Note: there is already an outstanding PR to resolve this issue: open-mmlab#2715
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.

3 participants