Add at::optional from https://github.com/akrzemi1/Optional#5530
Merged
colesbury merged 5 commits intopytorch:masterfrom Mar 5, 2018
Merged
Add at::optional from https://github.com/akrzemi1/Optional#5530colesbury merged 5 commits intopytorch:masterfrom
colesbury merged 5 commits intopytorch:masterfrom
Conversation
ezyang
approved these changes
Mar 2, 2018
Contributor
ezyang
left a comment
There was a problem hiding this comment.
Consider also leaving a URL breadcrumb to upstream
Contributor
|
roughly how do you plan to use it for reshape? |
Member
Author
|
@gchanan reshape needs to compute the strides of the reshaped tensor. It's convenient to implement this as a function that returns |
Contributor
|
@pytorchbot retest this please |
1 similar comment
Contributor
|
@pytorchbot retest this please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds at::optional which matches the API of std::optional from C++17. For details about the implementation, see https://github.com/akrzemi1/Optional.
I've moved the types from
std::experimentalto theatnamespace. This seems less likely to cause conflicting definitions, especially since PyTorch symbols are currently loaded withRTLD_GLOBAL.I've verified that it compiles, but I haven't added any uses as part of this PR. I plan to use internally within ATen to implement
reshape. We may also want to use it in place of undefined tensors in the public API.