Skip to content

c10::string_view -> std::string_view in executorch #7375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backends/vulkan/test/op_tests/utils/aten_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
OPT_LAYOUT = "::std::optional<at::Layout>"
OPT_MEMORY_FORMAT = "::std::optional<at::MemoryFormat>"
OPT_SCALAR_TYPE = "::std::optional<at::ScalarType>"
STRING = "c10::string_view"
STRING = "std::string_view"
OLD_STRING = "c10::string_view"
TWO_TENSOR_TUPLE = "::std::tuple<at::Tensor,at::Tensor>"
THREE_TENSOR_TUPLE = "::std::tuple<at::Tensor,at::Tensor,at::Tensor>"
TENSOR_VECTOR = "::std::vector<at::Tensor>"
3 changes: 2 additions & 1 deletion backends/vulkan/test/op_tests/utils/gen_computegraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
BOOL,
DOUBLE,
INT,
OLD_STRING,
OPT_AT_DOUBLE_ARRAY_REF,
OPT_AT_INT_ARRAY_REF,
OPT_AT_TENSOR,
Expand Down Expand Up @@ -398,7 +399,7 @@ def create_value_for( # noqa: C901
or ref.src_cpp_type == OPT_MEMORY_FORMAT
):
ret_str += "add_none(); \n"
elif ref.src_cpp_type == STRING:
elif ref.src_cpp_type == STRING or ref.src_cpp_type == OLD_STRING:
ret_str += f"add_string(std::string({ref.src_cpp_name})); \n"
elif ref.src_cpp_type == TWO_TENSOR_TUPLE:
ret_str += f"add_value_list({{{ref.name}_first, {ref.name}_second}}); \n"
Expand Down
5 changes: 3 additions & 2 deletions backends/vulkan/test/op_tests/utils/gen_correctness_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
BOOL,
DOUBLE,
INT,
OLD_STRING,
OPT_AT_DOUBLE_ARRAY_REF,
OPT_AT_INT_ARRAY_REF,
OPT_AT_TENSOR,
Expand Down Expand Up @@ -192,8 +193,8 @@ def create_input_data(self, arg: Argument, data: Any) -> str: # noqa: C901
ret_str += "std::nullopt;"
else:
ret_str += f"{str(data)};"
elif cpp_type == STRING:
ret_str += f'c10::string_view("{data}");'
elif cpp_type == STRING or cpp_type == OLD_STRING:
ret_str += f'std::string_view("{data}");'
elif (
cpp_type == OPT_SCALAR_TYPE
or cpp_type == OPT_LAYOUT
Expand Down
2 changes: 1 addition & 1 deletion runtime/core/exec_aten/exec_aten.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ using TensorShapeDynamism = executorch::runtime::TensorShapeDynamism;
using Tensor = at::Tensor;
using TensorList = at::TensorList;
using TensorImpl = at::TensorImpl;
using string_view = c10::string_view;
using string_view = std::string_view;
template <typename T>
using ArrayRef = c10::ArrayRef<T>;
template <typename T>
Expand Down
Loading