@@ -32,8 +32,8 @@ Tensor& add_1_out(const Tensor& a, Tensor& out) {
3232}
3333
3434Tensor& add_optional_scalar_out (
35- torch::executor ::optional<int64_t > s1,
36- torch::executor ::optional<int64_t > s2,
35+ std ::optional<int64_t > s1,
36+ std ::optional<int64_t > s2,
3737 Tensor& out) {
3838 if (s1.has_value ()) {
3939 out.mutable_data_ptr <int64_t >()[0 ] += s1.value ();
@@ -45,8 +45,8 @@ Tensor& add_optional_scalar_out(
4545}
4646
4747Tensor& add_optional_tensor_out (
48- torch::executor ::optional<torch::executor::Tensor> s1,
49- torch::executor ::optional<torch::executor::Tensor> s2,
48+ std ::optional<torch::executor::Tensor> s1,
49+ std ::optional<torch::executor::Tensor> s2,
5050 Tensor& out) {
5151 if (s1.has_value ()) {
5252 out.mutable_data_ptr <int64_t >()[0 ] +=
@@ -79,7 +79,7 @@ Tensor& sum_arrayref_tensor_out(
7979
8080Tensor& sum_arrayref_optional_tensor_out (
8181 torch::executor::ArrayRef<
82- torch::executor ::optional<torch::executor::Tensor>> a,
82+ std ::optional<torch::executor::Tensor>> a,
8383 Tensor& out) {
8484 for (int i = 0 ; i < a.size (); i++) {
8585 if (a[i].has_value ()) {
@@ -137,20 +137,20 @@ TEST_F(MakeATenFunctorFromETFunctorTest, TestTypeMap_Tensor) {
137137TEST_F (MakeATenFunctorFromETFunctorTest, TestTypeMap_Optionals) {
138138 // Scalar.
139139 EXPECT_TRUE ((std::is_same<
140- type_map<torch::executor ::optional<int64_t >>::type,
140+ type_map<std ::optional<int64_t >>::type,
141141 std::optional<int64_t >>::value));
142142 // Tensor.
143143 EXPECT_TRUE (
144144 (std::is_same<
145- type_map<torch::executor ::optional<torch::executor::Tensor>>::type,
145+ type_map<std ::optional<torch::executor::Tensor>>::type,
146146 std::optional<at::Tensor>>::value));
147147 // ArrayRef.
148148 EXPECT_TRUE ((std::is_same<
149- type_map<torch::executor ::optional<
149+ type_map<std ::optional<
150150 torch::executor::ArrayRef<int64_t >>>::type,
151151 std::optional<c10::ArrayRef<int64_t >>>::value));
152152 EXPECT_TRUE ((std::is_same<
153- type_map<torch::executor ::optional<
153+ type_map<std ::optional<
154154 torch::executor::ArrayRef<torch::executor::Tensor>>>::type,
155155 std::optional<c10::ArrayRef<at::Tensor>>>::value));
156156}
@@ -168,11 +168,11 @@ TEST_F(MakeATenFunctorFromETFunctorTest, TestTypeMap_ArrayRef) {
168168 // Optionals.
169169 EXPECT_TRUE ((std::is_same<
170170 type_map<torch::executor::ArrayRef<
171- torch::executor ::optional<int64_t >>>::type,
171+ std ::optional<int64_t >>>::type,
172172 c10::ArrayRef<std::optional<int64_t >>>::value));
173173 EXPECT_TRUE ((std::is_same<
174174 type_map<torch::executor::ArrayRef<
175- torch::executor ::optional<torch::executor::Tensor>>>::type,
175+ std ::optional<torch::executor::Tensor>>>::type,
176176 c10::ArrayRef<std::optional<at::Tensor>>>::value));
177177}
178178
@@ -193,17 +193,17 @@ TEST_F(MakeATenFunctorFromETFunctorTest, TestConvert_OptionalScalar) {
193193 // Convert optional at to et.
194194 auto optional_at_in = std::optional<int64_t >();
195195 auto optional_et =
196- type_convert<std::optional<int64_t >, torch::executor ::optional<int64_t >>(
196+ type_convert<std::optional<int64_t >, std ::optional<int64_t >>(
197197 optional_at_in)
198198 .call ();
199199 EXPECT_TRUE (
200- (std::is_same<decltype (optional_et), torch::executor ::optional<int64_t >>::
200+ (std::is_same<decltype (optional_et), std ::optional<int64_t >>::
201201 value));
202202
203203 // Convert optional et to at.
204- auto optional_et_in = torch::executor ::optional<int64_t >();
204+ auto optional_et_in = std ::optional<int64_t >();
205205 auto optional_at_out =
206- type_convert<torch::executor ::optional<int64_t >, std::optional<int64_t >>(
206+ type_convert<std ::optional<int64_t >, std::optional<int64_t >>(
207207 optional_et_in)
208208 .call ();
209209 EXPECT_TRUE (
@@ -216,17 +216,17 @@ TEST_F(MakeATenFunctorFromETFunctorTest, TestConvert_OptionalTensor) {
216216 auto optional_et =
217217 type_convert<
218218 std::optional<at::Tensor>,
219- torch::executor ::optional<torch::executor::Tensor>>(optional_at_in)
219+ std ::optional<torch::executor::Tensor>>(optional_at_in)
220220 .call ();
221221 EXPECT_TRUE ((std::is_same<
222222 decltype (optional_et),
223- torch::executor ::optional<torch::executor::Tensor>>::value));
223+ std ::optional<torch::executor::Tensor>>::value));
224224
225225 // Convert optional et to at.
226226 torch::executor::testing::TensorFactory<ScalarType::Int> tf;
227- auto et_in = torch::executor ::optional<torch::executor::Tensor>(tf.ones ({3 }));
227+ auto et_in = std ::optional<torch::executor::Tensor>(tf.ones ({3 }));
228228 auto optional_at_out = type_convert<
229- torch::executor ::optional<torch::executor::Tensor>,
229+ std ::optional<torch::executor::Tensor>,
230230 std::optional<at::Tensor>>(optional_et)
231231 .call ();
232232 EXPECT_TRUE (
@@ -429,15 +429,15 @@ TEST_F(MakeATenFunctorFromETFunctorTest, TestConvert_ConstRefOptionals) {
429429 auto const_optional_et =
430430 type_convert<
431431 const std::optional<int64_t >,
432- torch::executor ::optional<int64_t >>(const_optional_at_in)
432+ std ::optional<int64_t >>(const_optional_at_in)
433433 .call ();
434434 EXPECT_TRUE (const_optional_et.has_value ());
435435 EXPECT_EQ (const_optional_et.value (), 42 );
436436
437437 // Test optional scalar reference conversion
438438 std::optional<int64_t > optional_at_ref_in = std::optional<int64_t >(24 );
439439 auto optional_et_from_ref =
440- type_convert<std::optional<int64_t >&, torch::executor ::optional<int64_t >>(
440+ type_convert<std::optional<int64_t >&, std ::optional<int64_t >>(
441441 optional_at_ref_in)
442442 .call ();
443443 EXPECT_TRUE (optional_et_from_ref.has_value ());
@@ -449,7 +449,7 @@ TEST_F(MakeATenFunctorFromETFunctorTest, TestConvert_ConstRefOptionals) {
449449 auto const_optional_et_from_ref =
450450 type_convert<
451451 const std::optional<int64_t >&,
452- torch::executor ::optional<int64_t >>(const_optional_at_ref_in)
452+ std ::optional<int64_t >>(const_optional_at_ref_in)
453453 .call ();
454454 EXPECT_TRUE (const_optional_et_from_ref.has_value ());
455455 EXPECT_EQ (const_optional_et_from_ref.value (), 84 );
@@ -459,7 +459,7 @@ TEST_F(MakeATenFunctorFromETFunctorTest, TestConvert_ConstRefOptionals) {
459459 std::optional<at::Tensor>(torch::tensor ({5 }));
460460 auto const_optional_tensor_converter = type_convert<
461461 const std::optional<at::Tensor>,
462- torch::executor ::optional<torch::executor::Tensor>>(
462+ std ::optional<torch::executor::Tensor>>(
463463 const_optional_tensor_at_in);
464464 auto const_optional_tensor_et = const_optional_tensor_converter.call ();
465465 EXPECT_TRUE (const_optional_tensor_et.has_value ());
@@ -470,7 +470,7 @@ TEST_F(MakeATenFunctorFromETFunctorTest, TestConvert_ConstRefOptionals) {
470470 std::optional<at::Tensor>(torch::tensor ({7 }));
471471 auto optional_tensor_converter_from_ref = type_convert<
472472 std::optional<at::Tensor>&,
473- torch::executor ::optional<torch::executor::Tensor>>(
473+ std ::optional<torch::executor::Tensor>>(
474474 optional_tensor_at_ref_in);
475475 auto optional_tensor_et_from_ref = optional_tensor_converter_from_ref.call ();
476476 EXPECT_TRUE (optional_tensor_et_from_ref.has_value ());
@@ -482,7 +482,7 @@ TEST_F(MakeATenFunctorFromETFunctorTest, TestConvert_ConstRefOptionals) {
482482 std::optional<at::Tensor>(torch::tensor ({9 }));
483483 auto const_optional_tensor_converter_from_ref = type_convert<
484484 const std::optional<at::Tensor>&,
485- torch::executor ::optional<torch::executor::Tensor>>(
485+ std ::optional<torch::executor::Tensor>>(
486486 const_optional_tensor_at_ref_in);
487487 auto const_optional_tensor_et_from_ref =
488488 const_optional_tensor_converter_from_ref.call ();
@@ -496,7 +496,7 @@ TEST_F(MakeATenFunctorFromETFunctorTest, TestConvert_ConstRefOptionals) {
496496 auto empty_const_optional_et =
497497 type_convert<
498498 const std::optional<int64_t >,
499- torch::executor ::optional<int64_t >>(empty_const_optional_at_in)
499+ std ::optional<int64_t >>(empty_const_optional_at_in)
500500 .call ();
501501 EXPECT_FALSE (empty_const_optional_et.has_value ());
502502
@@ -505,7 +505,7 @@ TEST_F(MakeATenFunctorFromETFunctorTest, TestConvert_ConstRefOptionals) {
505505 auto empty_const_optional_tensor_et =
506506 type_convert<
507507 const std::optional<at::Tensor>,
508- torch::executor ::optional<torch::executor::Tensor>>(
508+ std ::optional<torch::executor::Tensor>>(
509509 empty_const_optional_tensor_at_in)
510510 .call ();
511511 EXPECT_FALSE (empty_const_optional_tensor_et.has_value ());
0 commit comments