mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Use std::string_view in torchgen (#157050)
Let the generated code use std::sv Pull Request resolved: https://github.com/pytorch/pytorch/pull/157050 Approved by: https://github.com/ezyang
This commit is contained in:
@ -683,7 +683,7 @@ def argument_type_str(
|
||||
elif t.name == BaseTy.float:
|
||||
return "double"
|
||||
elif t.name == BaseTy.str:
|
||||
return "c10::string_view"
|
||||
return "std::string_view"
|
||||
elif t.name in [
|
||||
BaseTy.Tensor,
|
||||
BaseTy.bool,
|
||||
|
@ -52,7 +52,7 @@ float8_e5m2fnuzT = BaseCppType("at", "Float8_e5m2fnuz")
|
||||
float8_e4m3fnT = BaseCppType("at", "Float8_e4m3fn")
|
||||
float8_e4m3fnuzT = BaseCppType("at", "Float8_e4m3fnuz")
|
||||
float8_e8m0fnuT = BaseCppType("at", "Float8_e8m0fnu")
|
||||
stringT = BaseCppType("c10", "string_view")
|
||||
stringT = BaseCppType("::std", "string_view")
|
||||
generatorT = BaseCppType("at", "Generator")
|
||||
scalarTypeT = BaseCppType("at", "ScalarType")
|
||||
tensorT = BaseCppType("at", "Tensor")
|
||||
|
Reference in New Issue
Block a user