Skip to content

Commit d956505

Browse files
r-barnesfacebook-github-bot
authored andcommitted
refactor: c10::string_view -> std::string_view in executorch
Differential Revision: D67312326
1 parent b0bf9aa commit d956505

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

backends/vulkan/test/op_tests/utils/aten_types.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
OPT_LAYOUT = "::std::optional<at::Layout>"
2525
OPT_MEMORY_FORMAT = "::std::optional<at::MemoryFormat>"
2626
OPT_SCALAR_TYPE = "::std::optional<at::ScalarType>"
27-
STRING = "c10::string_view"
27+
STRING = "std::string_view"
28+
OLD_STRING = "c10::string_view"
2829
TWO_TENSOR_TUPLE = "::std::tuple<at::Tensor,at::Tensor>"
2930
THREE_TENSOR_TUPLE = "::std::tuple<at::Tensor,at::Tensor,at::Tensor>"
3031
TENSOR_VECTOR = "::std::vector<at::Tensor>"

backends/vulkan/test/op_tests/utils/gen_computegraph.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
BOOL,
1717
DOUBLE,
1818
INT,
19+
OLD_STRING,
1920
OPT_AT_DOUBLE_ARRAY_REF,
2021
OPT_AT_INT_ARRAY_REF,
2122
OPT_AT_TENSOR,
@@ -398,7 +399,7 @@ def create_value_for( # noqa: C901
398399
or ref.src_cpp_type == OPT_MEMORY_FORMAT
399400
):
400401
ret_str += "add_none(); \n"
401-
elif ref.src_cpp_type == STRING:
402+
elif ref.src_cpp_type == STRING or ref.src_cpp_type == OLD_STRING:
402403
ret_str += f"add_string(std::string({ref.src_cpp_name})); \n"
403404
elif ref.src_cpp_type == TWO_TENSOR_TUPLE:
404405
ret_str += f"add_value_list({{{ref.name}_first, {ref.name}_second}}); \n"

backends/vulkan/test/op_tests/utils/gen_correctness_base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
BOOL,
1616
DOUBLE,
1717
INT,
18+
OLD_STRING,
1819
OPT_AT_DOUBLE_ARRAY_REF,
1920
OPT_AT_INT_ARRAY_REF,
2021
OPT_AT_TENSOR,
@@ -192,8 +193,8 @@ def create_input_data(self, arg: Argument, data: Any) -> str: # noqa: C901
192193
ret_str += "std::nullopt;"
193194
else:
194195
ret_str += f"{str(data)};"
195-
elif cpp_type == STRING:
196-
ret_str += f'c10::string_view("{data}");'
196+
elif cpp_type == STRING or cpp_type == OLD_STRING:
197+
ret_str += f'std::string_view("{data}");'
197198
elif (
198199
cpp_type == OPT_SCALAR_TYPE
199200
or cpp_type == OPT_LAYOUT

runtime/core/exec_aten/exec_aten.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ using TensorShapeDynamism = executorch::runtime::TensorShapeDynamism;
5757
using Tensor = at::Tensor;
5858
using TensorList = at::TensorList;
5959
using TensorImpl = at::TensorImpl;
60-
using string_view = c10::string_view;
60+
using string_view = std::string_view;
6161
template <typename T>
6262
using ArrayRef = c10::ArrayRef<T>;
6363
template <typename T>

0 commit comments

Comments
 (0)