Skip to content

Commit f606d83

Browse files
hyeontaektensorflower-gardener
authored andcommitted
Use bytes proto field type for string values of xla::PjRtValueType to bytes
`xla::PjRtValueType` is defined in C++, where its `std::string` value can contain any string (not necessarily UTF-8). Protobuf verison 3 requires a `string` field to contain UTF-8, so it is more suitable to use `bytes` to express this value. (Note that the string value of `xla::PjRtValueType` would be often consumed by Python, where nanobind would convert `std::string` into Python `str` with UTF-8 decoding. However, this is what some users of `xla::PjRtValueType` choose to do; this is not sufficient enough to constrain the string to be UTF-8 only in C++ APIs.) This is a preemptive change; there is no known problem of using a `string` field previously. PiperOrigin-RevId: 620315110
1 parent 8958c65 commit f606d83

File tree

1 file changed

+1
-1
lines changed
  • third_party/xla/xla/python/ifrt_proxy/common

1 file changed

+1
-1
lines changed

third_party/xla/xla/python/ifrt_proxy/common/types.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ message Variant {
8585
}
8686

8787
oneof value {
88-
string string_value = 1;
88+
bytes string_value = 1;
8989
sfixed64 int64_value = 2;
9090
Int64List int64_list = 3;
9191
float float_value = 4;

0 commit comments

Comments
 (0)