Revert "[1/N] Change #include <c10/util/Optional.h> to #include <optional> (#128301)"

This reverts commit bd72e28314d8d63bb347becb8309f5ac7761c6b5.

Reverted https://github.com/pytorch/pytorch/pull/128301 on behalf of https://github.com/huydhn due to Sorry for reverting your change but it fails XLA build bd72e28314. Please rebase your PR before relanding because I think the failure is hidden by an unrelated broken trunk XLA failure from your current base commit ([comment](https://github.com/pytorch/pytorch/pull/128301#issuecomment-2169035822))
This commit is contained in:
PyTorch MergeBot
2024-06-15 01:58:20 +00:00
parent 5efe71f134
commit 846bb30e13
330 changed files with 1207 additions and 1208 deletions

View File

@ -351,8 +351,8 @@ struct TORCH_API ViewFunc {
/// Returns a clone of this ViewFunc, optionally with the specified saved
/// state.
virtual std::unique_ptr<ViewFunc> clone_and_set(
std::optional<std::vector<c10::SymInt>> = std::nullopt,
std::optional<std::vector<at::Tensor>> = std::nullopt) const = 0;
std::optional<std::vector<c10::SymInt>> = c10::nullopt,
std::optional<std::vector<at::Tensor>> = c10::nullopt) const = 0;
protected:
/// Sets the values of any SymInts in the saved state. The input vector size
@ -382,8 +382,8 @@ struct ChainedViewFunc : public ViewFunc {
}
virtual at::Tensor operator()(const at::Tensor&) const override;
virtual std::unique_ptr<ViewFunc> clone_and_set(
std::optional<std::vector<c10::SymInt>> = std::nullopt,
std::optional<std::vector<at::Tensor>> = std::nullopt) const override;
std::optional<std::vector<c10::SymInt>> = c10::nullopt,
std::optional<std::vector<at::Tensor>> = c10::nullopt) const override;
private:
std::unique_ptr<ViewFunc> first;
@ -398,8 +398,8 @@ struct ErroringViewFunc : public ViewFunc {
TORCH_CHECK(false, error_msg);
}
virtual std::unique_ptr<ViewFunc> clone_and_set(
std::optional<std::vector<c10::SymInt>> = std::nullopt,
std::optional<std::vector<at::Tensor>> = std::nullopt) const override {
std::optional<std::vector<c10::SymInt>> = c10::nullopt,
std::optional<std::vector<at::Tensor>> = c10::nullopt) const override {
return std::make_unique<ErroringViewFunc>(error_msg);
}