Skip to content

Commit 2da24ae

Browse files
authored
Emit std::string_view/std::optional from codegen (pytorch#21000)
Codegen still emitted the deprecated `torch::executor::string_view`/`optional` aliases; emit `std::string_view`/`std::optional` directly. Verified by building `optimized_ops_lib` and `portable_ops_lib` locally. Authored with Claude.
1 parent aaacd03 commit 2da24ae

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

codegen/api/types/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818

1919
halfT = BaseCppType("torch::executor", "Half")
2020
bfloat16T = BaseCppType("torch::executor", "BFloat16")
21-
stringT = BaseCppType("torch::executor", "string_view")
21+
stringT = BaseCppType("std", "string_view")
2222
scalarTypeT = BaseCppType("torch::executor", "ScalarType")
2323
tensorT = BaseCppType("torch::executor", "Tensor")
2424
tensorListT = BaseCppType("torch::executor", "TensorList")
2525
scalarT = BaseCppType("torch::executor", "Scalar")
2626
memoryFormatT = BaseCppType("torch::executor", "MemoryFormat")
2727
intArrayRefT = BaseCppType("torch::executor", "IntArrayRef")
28-
optionalT = BaseCppType("torch::executor", "optional")
28+
optionalT = BaseCppType("std", "optional")
2929
contextT = BaseCppType("torch::executor", "KernelRuntimeContext")
3030

3131
contextExpr = Expr(

0 commit comments

Comments
 (0)