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

convenience wrapper of torch.set_num_threads #1001

Merged
merged 3 commits into from Mar 11, 2021
Merged

Conversation

mjayasur
Copy link
Contributor

resolve #1000

@codecov
Copy link

codecov bot commented Mar 11, 2021

Codecov Report

Merging #1001 (c60d0cd) into master (57c992a) will decrease coverage by 0.03%.
The diff coverage is 62.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1001      +/-   ##
==========================================
- Coverage   89.72%   89.69%   -0.04%     
==========================================
  Files          87       87              
  Lines        6182     6190       +8     
==========================================
+ Hits         5547     5552       +5     
- Misses        635      638       +3     
Impacted Files Coverage Δ
scvi/_settings.py 87.91% <62.50%> (-2.45%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57c992a...c60d0cd. Read the comment docs.

Comment on lines 124 to 127
def set_num_threads(self, num: int):
"""Sets number of threads torch will use to `num`."""
torch.set_num_threads(num)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

num_threads needs to be a property with a setter, the setter runs num threads, you can default the property to return None?

Copy link
Member

@adamgayoso adamgayoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but can you add an example to the docstring in the init?

@adamgayoso adamgayoso merged commit b510106 into master Mar 11, 2021
@adamgayoso adamgayoso deleted the michael/setnumthreads branch March 11, 2021 21:02
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.

CPU usage
2 participants