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

c10::optional -> std::optional #394

Merged
merged 1 commit into from
Jan 10, 2025
Merged

c10::optional -> std::optional #394

merged 1 commit into from
Jan 10, 2025

Conversation

r-barnes
Copy link
Contributor

@r-barnes r-barnes commented Jan 9, 2025

Since Nov 29, 2023, PyTorch's c10::optional has been an alias for std::optional (link).

As of Dec 17, 2024, PyTorch has begun taking steps to begin removing the c10::optional alias entirely (link). The old API remains available, for now, but you can check whether your code has eliminated all instances of deprecated APIs by compiling with C10_NODEPRECATED defined as a preprocessor flag (-DC10_NODEPRECATED).

This PR converts your existing usages of c10::optional to std::optional (same for nullopt).

(Additional deprecated APIs include C10_UNUSED, C10_NODISCARD, and c10::string_view.)

@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.09%. Comparing base (2d55981) to head (c4a651f).
Report is 5 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #394   +/-   ##
=======================================
  Coverage   73.09%   73.09%           
=======================================
  Files          29       29           
  Lines        1171     1171           
=======================================
  Hits          856      856           
  Misses        315      315           

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

@rusty1s rusty1s merged commit 36a822f into rusty1s:master Jan 10, 2025
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.

3 participants