Skip to content

Commit 911fb0b

Browse files
authored
Make exec_aten::optional and string_view direct aliases for std versions (#11321)
I'm seeing unexpected numerics changes on #10541. Doing this as an incremental step to make sure that the actual change to optional/string_view is not causing them.
1 parent 554db00 commit 911fb0b

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

runtime/core/exec_aten/exec_aten.h

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,18 @@ namespace aten {
6767

6868
using TensorShapeDynamism = executorch::runtime::TensorShapeDynamism;
6969

70+
using std::nullopt;
71+
using std::nullopt_t;
72+
using std::optional;
73+
using std::string_view;
74+
7075
#ifdef USE_ATEN_LIB
7176

7277
using Tensor = at::Tensor;
7378
using TensorList = at::TensorList;
7479
using TensorImpl = at::TensorImpl;
75-
using string_view = std::string_view;
7680
template <typename T>
7781
using ArrayRef = c10::ArrayRef<T>;
78-
template <typename T>
79-
using optional = std::optional<T>;
80-
using nullopt_t = std::nullopt_t;
81-
using std::nullopt;
8282
using ScalarType = at::ScalarType;
8383
using Scalar = c10::Scalar;
8484
using MemoryFormat = c10::MemoryFormat;
@@ -126,14 +126,8 @@ inline ssize_t compute_numel(const SizesType* sizes, ssize_t dim) {
126126

127127
using Tensor = torch::executor::Tensor;
128128
using TensorImpl = torch::executor::TensorImpl;
129-
using string_view = torch::executor::string_view;
130129
template <typename T>
131130
using ArrayRef = torch::executor::ArrayRef<T>;
132-
template <typename T>
133-
using optional = torch::executor::optional<T>;
134-
using nullopt_t = torch::executor::nullopt_t;
135-
// NOLINTNEXTLINE(facebook-hte-NamespaceScopedStaticDeclaration)
136-
using std::nullopt;
137131
using ScalarType = torch::executor::ScalarType;
138132
using TensorList = ArrayRef<Tensor>;
139133
using Scalar = torch::executor::Scalar;

0 commit comments

Comments
 (0)