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

Default dtype and device to SB environment #38

Merged
merged 13 commits into from
Nov 17, 2023

Conversation

bqth29
Copy link
Owner

@bqth29 bqth29 commented Oct 21, 2023

💬 Pull Request Description

The get/set/reset_env functions have been moved to their own file named environment.py and all the dtype and device occurences in methods signatures have been made optional with a default value to None.

✔️ Check list

  • The code matches the styling rules
  • The new code is covered by relevant tests
  • Documentation was added

🚀 New features

None

🐞 Bug fixes

None

📣 Supplementary information

The configure default values for the tensors' dtype and device, it is recommanded to ather use PyTorch's torch.set_default_dtype and torch.set_default_device functions.

We considered the possibility of configuring these values via the SB environment directly, but this would risk creating a mismatch between the information stored in the environment and the actual default value, should a call be made to one of PyTorch's functions in the meantime.

@bqth29 bqth29 marked this pull request as draft October 21, 2023 11:29
@codecov
Copy link

codecov bot commented Oct 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (775cc10) 100.00% compared to head (9885b97) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #38   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           38        40    +2     
  Lines         1460      1484   +24     
=========================================
+ Hits          1460      1484   +24     

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

@bqth29 bqth29 marked this pull request as ready for review October 21, 2023 11:56
@bqth29 bqth29 requested a review from BusyBeaver-42 October 21, 2023 11:56
@BusyBeaver-42 BusyBeaver-42 merged commit 7ca29f3 into main Nov 17, 2023
12 checks passed
@BusyBeaver-42 BusyBeaver-42 deleted the feature/default_dtype_and_device_in_env branch November 17, 2023 09:47
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