Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ Process 87741 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x00000001024e2628 libtorch_python.dylib`at::indexing::impl::applySelect(self=0x00000001004ee8a8, dim=0, index=(data_ = 3), real_dim=0, (null)=0x000000016fdfe535, self_sizes= Has Value=true ) at TensorIndexing.h:239:7
236 const at::Device& /*self_device*/,
237 const c10::optional<SymIntArrayRef>& self_sizes) {
237 const std::optional<SymIntArrayRef>& self_sizes) {
238 // See NOTE [nested tensor size for indexing]
-> 239 if (self_sizes.has_value()) {
240 auto maybe_index = index.maybe_as_int();
Expand Down Expand Up @@ -1081,10 +1081,6 @@ Here are a few well known pitfalls and workarounds:
catch all of these problems: stay vigilant to the possibility that
your crash is due to a real memory problem.

* (NVCC) `c10::optional` does not work when used from device code. Don't use
it from kernels. Upstream issue: https://github.com/akrzemi1/Optional/issues/58
and our local issue #10329.

* `constexpr` generally works less well on MSVC.

* The idiom `static_assert(f() == f())` to test if `f` is constexpr
Expand Down
4 changes: 2 additions & 2 deletions c10/core/StorageImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ C10_API void warnDeprecatedDataPtr();
// Currently used only for storing a custom error message
// used when throwing an exception when data_ptr is accessed.
struct C10_API StorageExtraMeta {
c10::optional<std::string> custom_data_ptr_error_msg_ = c10::nullopt;
std::optional<std::string> custom_data_ptr_error_msg_ = c10::nullopt;
StorageExtraMeta() = default;
StorageExtraMeta(const StorageExtraMeta& other) {
if (other.custom_data_ptr_error_msg_) {
Expand Down Expand Up @@ -283,7 +283,7 @@ struct C10_API StorageImpl : public c10::intrusive_ptr_target {
[[noreturn]] void throw_data_ptr_access_error() const;

void release_data_and_set_meta_custom_data_ptr_error_msg_(
c10::optional<std::string> s) {
std::optional<std::string> s) {
throw_on_immutable_data_ptr_ = true;
get_extra_meta().custom_data_ptr_error_msg_ = std::move(s);
refresh_has_data_ptr_check();
Expand Down