diff --git a/backends/vulkan/test/op_tests/utils/aten_types.py b/backends/vulkan/test/op_tests/utils/aten_types.py index 186f5afb78..6ad2f568e9 100644 --- a/backends/vulkan/test/op_tests/utils/aten_types.py +++ b/backends/vulkan/test/op_tests/utils/aten_types.py @@ -24,7 +24,8 @@ OPT_LAYOUT = "::std::optional" OPT_MEMORY_FORMAT = "::std::optional" OPT_SCALAR_TYPE = "::std::optional" -STRING = "c10::string_view" +STRING = "std::string_view" +OLD_STRING = "c10::string_view" TWO_TENSOR_TUPLE = "::std::tuple" THREE_TENSOR_TUPLE = "::std::tuple" TENSOR_VECTOR = "::std::vector" diff --git a/backends/vulkan/test/op_tests/utils/gen_computegraph.py b/backends/vulkan/test/op_tests/utils/gen_computegraph.py index 8cefb5be04..472127ffe2 100644 --- a/backends/vulkan/test/op_tests/utils/gen_computegraph.py +++ b/backends/vulkan/test/op_tests/utils/gen_computegraph.py @@ -16,6 +16,7 @@ BOOL, DOUBLE, INT, + OLD_STRING, OPT_AT_DOUBLE_ARRAY_REF, OPT_AT_INT_ARRAY_REF, OPT_AT_TENSOR, @@ -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" diff --git a/backends/vulkan/test/op_tests/utils/gen_correctness_base.py b/backends/vulkan/test/op_tests/utils/gen_correctness_base.py index def3508a8a..3d9aa6aa80 100644 --- a/backends/vulkan/test/op_tests/utils/gen_correctness_base.py +++ b/backends/vulkan/test/op_tests/utils/gen_correctness_base.py @@ -15,6 +15,7 @@ BOOL, DOUBLE, INT, + OLD_STRING, OPT_AT_DOUBLE_ARRAY_REF, OPT_AT_INT_ARRAY_REF, OPT_AT_TENSOR, @@ -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 diff --git a/runtime/core/exec_aten/exec_aten.h b/runtime/core/exec_aten/exec_aten.h index 708fb69d57..4b920504e6 100644 --- a/runtime/core/exec_aten/exec_aten.h +++ b/runtime/core/exec_aten/exec_aten.h @@ -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 using ArrayRef = c10::ArrayRef; template