mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[1/N] Change #include <c10/util/Optional.h> to #include <optional> (#128301)
Fixes #ISSUE_NUMBER Pull Request resolved: https://github.com/pytorch/pytorch/pull/128301 Approved by: https://github.com/ezyang
This commit is contained in:
@ -320,7 +320,7 @@ std::pair<std::shared_ptr<Graph>, std::optional<Module>> PrepareForStaticModule(
|
||||
const StaticModuleOptions& opts,
|
||||
std::vector<IValue> sample_inputs) {
|
||||
PrepareGraphForStaticModule(graph, opts, std::move(sample_inputs));
|
||||
return std::make_pair(graph, c10::nullopt);
|
||||
return std::make_pair(graph, std::nullopt);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@ -573,7 +573,7 @@ StaticModule::StaticModule(
|
||||
const auto num_schema_args = schema_->arguments().size();
|
||||
DCHECK(num_schema_args > 0);
|
||||
if (removeSelfFromGraphInput(graph_)) {
|
||||
module_ = c10::nullopt;
|
||||
module_ = std::nullopt;
|
||||
num_inputs_ = num_schema_args - 1;
|
||||
}
|
||||
}
|
||||
@ -1251,7 +1251,7 @@ bool BlockRunner::fast_check_and_correct_overlap_with(
|
||||
auto& tensor = tensor_ival.toTensor();
|
||||
if (planner_->overlapWithInternalBuffer(tensor.data_ptr())) {
|
||||
DLOG(INFO) << "Detected alias for node: " << PrintNode(n.node());
|
||||
tensor_ival = at::native::clone(tensor, c10::nullopt);
|
||||
tensor_ival = at::native::clone(tensor, std::nullopt);
|
||||
n.set_outputs_memory_overlap_detected();
|
||||
return true;
|
||||
}
|
||||
@ -2218,7 +2218,7 @@ bool ProcessedNode::check_and_correct_overlap_with(
|
||||
auto& tensor = output_ival.toTensor();
|
||||
if (!checkNoMemoryOverlap(input, tensor)) {
|
||||
DLOG(INFO) << "Detected alias for node: " << PrintNode(node());
|
||||
output_ival = at::native::clone(tensor, c10::nullopt);
|
||||
output_ival = at::native::clone(tensor, std::nullopt);
|
||||
set_outputs_memory_overlap_detected();
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user