Skip to content

Commit

Permalink
Change #include <c10/util/Optional.h> to #include <optional> (#7241)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyyever committed Jun 12, 2024
1 parent 8cd6ad4 commit c65e87b
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 23 deletions.
3 changes: 2 additions & 1 deletion torch_xla/csrc/convert_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#define XLA_TORCH_XLA_CSRC_CONVERT_OPS_H_

#include <c10/core/ScalarType.h>
#include <c10/util/Optional.h>

#include <optional>

#include "torch_xla/csrc/device.h"
#include "xla/client/xla_builder.h"
Expand Down
2 changes: 1 addition & 1 deletion torch_xla/csrc/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#define XLA_TORCH_XLA_CSRC_HELPERS_H_

#include <c10/core/Scalar.h>
#include <c10/util/Optional.h>
#include <torch/csrc/lazy/core/shape.h>
#include <torch/csrc/lazy/core/util.h>

#include <functional>
#include <optional>
#include <tuple>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion torch_xla/csrc/init_python_bindings.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <ATen/dlpack.h>
#include <Python.h>
#include <c10/core/Device.h>
#include <c10/util/Optional.h>
#include <google/protobuf/text_format.h>
#include <torch/csrc/autograd/utils/wrap_outputs.h>
#include <torch/csrc/autograd/variable.h>
Expand All @@ -13,6 +12,7 @@

#include <cstring>
#include <fstream>
#include <optional>
#include <sstream>
#include <string>
#include <thread>
Expand Down
5 changes: 3 additions & 2 deletions torch_xla/csrc/ops/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#define XLA_TORCH_XLA_CSRC_OPS_CAST_H_

#include <c10/core/ScalarType.h>
#include <c10/util/Optional.h>

#include <optional>

#include "torch_xla/csrc/ir.h"

Expand Down Expand Up @@ -34,4 +35,4 @@ class Cast : public XlaNode {

} // namespace torch_xla

#endif // XLA_TORCH_XLA_CSRC_OPS_CAST_H_
#endif // XLA_TORCH_XLA_CSRC_OPS_CAST_H_
5 changes: 3 additions & 2 deletions torch_xla/csrc/ops/cumprod.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#define XLA_TORCH_XLA_CSRC_OPS_CUMPROD_H_

#include <c10/core/ScalarType.h>
#include <c10/util/Optional.h>

#include <optional>

#include "torch_xla/csrc/ir.h"

Expand Down Expand Up @@ -30,4 +31,4 @@ class CumProd : public XlaNode {

} // namespace torch_xla

#endif // XLA_TORCH_XLA_CSRC_OPS_CUMPROD_H_
#endif // XLA_TORCH_XLA_CSRC_OPS_CUMPROD_H_
5 changes: 3 additions & 2 deletions torch_xla/csrc/ops/cumsum.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#define XLA_TORCH_XLA_CSRC_OPS_CUMSUM_H_

#include <c10/core/ScalarType.h>
#include <c10/util/Optional.h>

#include <optional>

#include "torch_xla/csrc/ir.h"

Expand Down Expand Up @@ -30,4 +31,4 @@ class CumSum : public XlaNode {

} // namespace torch_xla

#endif // XLA_TORCH_XLA_CSRC_OPS_CUMSUM_H_
#endif // XLA_TORCH_XLA_CSRC_OPS_CUMSUM_H_
5 changes: 3 additions & 2 deletions torch_xla/csrc/ops/log_softmax.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#define XLA_TORCH_XLA_CSRC_OPS_LOG_SOFTMAX_H_

#include <c10/core/ScalarType.h>
#include <c10/util/Optional.h>

#include <optional>

#include "torch_xla/csrc/ir.h"

Expand Down Expand Up @@ -31,4 +32,4 @@ class LogSoftmax : public XlaNode {

} // namespace torch_xla

#endif // XLA_TORCH_XLA_CSRC_OPS_LOG_SOFTMAX_H_
#endif // XLA_TORCH_XLA_CSRC_OPS_LOG_SOFTMAX_H_
4 changes: 1 addition & 3 deletions torch_xla/csrc/ops/logsumexp.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef XLA_TORCH_XLA_CSRC_OPS_LOGSUMEXP_H_
#define XLA_TORCH_XLA_CSRC_OPS_LOGSUMEXP_H_

#include <c10/util/Optional.h>

#include <vector>

#include "torch_xla/csrc/ir.h"
Expand Down Expand Up @@ -31,4 +29,4 @@ class Logsumexp : public XlaNode {

} // namespace torch_xla

#endif // XLA_TORCH_XLA_CSRC_OPS_LOGSUMEXP_H_
#endif // XLA_TORCH_XLA_CSRC_OPS_LOGSUMEXP_H_
4 changes: 2 additions & 2 deletions torch_xla/csrc/ops/mean.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define XLA_TORCH_XLA_CSRC_OPS_MEAN_H_

#include <c10/core/ScalarType.h>
#include <c10/util/Optional.h>

#include <optional>
#include <vector>

#include "torch_xla/csrc/ir.h"
Expand Down Expand Up @@ -36,4 +36,4 @@ class Mean : public XlaNode {

} // namespace torch_xla

#endif // XLA_TORCH_XLA_CSRC_OPS_MEAN_H_
#endif // XLA_TORCH_XLA_CSRC_OPS_MEAN_H_
5 changes: 3 additions & 2 deletions torch_xla/csrc/ops/prod.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#define XLA_TORCH_XLA_CSRC_OPS_PROD_H_

#include <c10/core/ScalarType.h>
#include <c10/util/Optional.h>

#include <optional>

#include "absl/types/span.h"
#include "torch_xla/csrc/ir.h"
Expand Down Expand Up @@ -34,4 +35,4 @@ class Prod : public XlaNode {

} // namespace torch_xla

#endif // XLA_TORCH_XLA_CSRC_OPS_PROD_H_
#endif // XLA_TORCH_XLA_CSRC_OPS_PROD_H_
5 changes: 3 additions & 2 deletions torch_xla/csrc/ops/softmax.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#define XLA_TORCH_XLA_CSRC_OPS_SOFTMAX_H_

#include <c10/core/ScalarType.h>
#include <c10/util/Optional.h>

#include <optional>

#include "torch_xla/csrc/ir.h"

Expand Down Expand Up @@ -30,4 +31,4 @@ class Softmax : public XlaNode {

} // namespace torch_xla

#endif // XLA_TORCH_XLA_CSRC_OPS_SOFTMAX_H_
#endif // XLA_TORCH_XLA_CSRC_OPS_SOFTMAX_H_
5 changes: 3 additions & 2 deletions torch_xla/csrc/ops/sum.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#define XLA_TORCH_XLA_CSRC_OPS_SUM_H_

#include <c10/core/ScalarType.h>
#include <c10/util/Optional.h>

#include <optional>

#include "absl/types/span.h"
#include "torch_xla/csrc/ir.h"
Expand Down Expand Up @@ -34,4 +35,4 @@ class Sum : public XlaNode {

} // namespace torch_xla

#endif // XLA_TORCH_XLA_CSRC_OPS_SUM_H_
#endif // XLA_TORCH_XLA_CSRC_OPS_SUM_H_
3 changes: 2 additions & 1 deletion torch_xla/csrc/torch_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
#include <ATen/ATen.h>
#include <ATen/FunctionalTensorWrapper.h>
#include <c10/core/ScalarType.h>
#include <c10/util/Optional.h>
#include <torch/csrc/lazy/core/dynamic_ir.h>
#include <torch/csrc/lazy/core/hash.h>
#include <torch/csrc/lazy/core/tensor.h>
#include <torch/csrc/lazy/core/util.h>

#include <optional>

#include "torch_xla/csrc/runtime/debug_macros.h"
#include "xla/shape.h"

Expand Down

0 comments on commit c65e87b

Please sign in to comment.