and define them only once per .cc file. Previous code defined them multiple times and relied on 'inline' keyword to avoid ODR conflicts, but someone reported this not working with their build (ODR violation was reported). Change: 120454125
112 lines
2.9 KiB
Protocol Buffer
112 lines
2.9 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package tensorflow.test;
|
|
|
|
message TestAllTypes {
|
|
message NestedMessage {
|
|
message DoubleNestedMessage {
|
|
string optional_string = 1;
|
|
}
|
|
|
|
int32 optional_int32 = 1;
|
|
repeated int32 repeated_int32 = 2;
|
|
DoubleNestedMessage msg = 3;
|
|
int64 optional_int64 = 4;
|
|
}
|
|
|
|
enum NestedEnum {
|
|
ZERO = 0;
|
|
FOO = 1;
|
|
BAR = 2;
|
|
BAZ = 3;
|
|
NEG = -1; // Intentionally negative.
|
|
}
|
|
|
|
// Singular
|
|
int32 optional_int32 = 1000; // use large tag to test output order.
|
|
int64 optional_int64 = 2;
|
|
uint32 optional_uint32 = 3;
|
|
uint64 optional_uint64 = 999; // use large tag to test output order.
|
|
sint32 optional_sint32 = 5;
|
|
sint64 optional_sint64 = 6;
|
|
fixed32 optional_fixed32 = 7;
|
|
fixed64 optional_fixed64 = 8;
|
|
sfixed32 optional_sfixed32 = 9;
|
|
sfixed64 optional_sfixed64 = 10;
|
|
float optional_float = 11;
|
|
double optional_double = 12;
|
|
bool optional_bool = 13;
|
|
string optional_string = 14;
|
|
bytes optional_bytes = 15;
|
|
|
|
NestedMessage optional_nested_message = 18;
|
|
ForeignMessage optional_foreign_message = 19;
|
|
|
|
NestedEnum optional_nested_enum = 21;
|
|
ForeignEnum optional_foreign_enum = 22;
|
|
|
|
string optional_cord = 25;
|
|
|
|
// Repeated
|
|
repeated int32 repeated_int32 = 31;
|
|
repeated int64 repeated_int64 = 32;
|
|
repeated uint32 repeated_uint32 = 33;
|
|
repeated uint64 repeated_uint64 = 34;
|
|
repeated sint32 repeated_sint32 = 35;
|
|
repeated sint64 repeated_sint64 = 36;
|
|
repeated fixed32 repeated_fixed32 = 37;
|
|
repeated fixed64 repeated_fixed64 = 38;
|
|
repeated sfixed32 repeated_sfixed32 = 39;
|
|
repeated sfixed64 repeated_sfixed64 = 40;
|
|
repeated float repeated_float = 41;
|
|
repeated double repeated_double = 42;
|
|
repeated bool repeated_bool = 43;
|
|
repeated string repeated_string = 44;
|
|
repeated bytes repeated_bytes = 45;
|
|
|
|
repeated NestedMessage repeated_nested_message = 48;
|
|
repeated NestedEnum repeated_nested_enum = 51;
|
|
|
|
repeated string repeated_cord = 55;
|
|
|
|
oneof oneof_field {
|
|
uint32 oneof_uint32 = 111;
|
|
NestedMessage oneof_nested_message = 112;
|
|
string oneof_string = 113;
|
|
bytes oneof_bytes = 114;
|
|
NestedEnum oneof_enum = 100;
|
|
}
|
|
|
|
map<string, NestedMessage> map_string_to_message = 58;
|
|
map<int32, NestedMessage> map_int32_to_message = 59;
|
|
map<int64, NestedMessage> map_int64_to_message = 60;
|
|
map<bool, NestedMessage> map_bool_to_message = 61;
|
|
map<string, int64> map_string_to_int64 = 62;
|
|
map<int64, string> map_int64_to_string = 63;
|
|
map<string, NestedMessage> another_map_string_to_message = 65;
|
|
|
|
repeated int64 packed_repeated_int64 = 64 [packed = true];
|
|
}
|
|
|
|
// A recursive message.
|
|
message NestedTestAllTypes {
|
|
NestedTestAllTypes child = 1;
|
|
TestAllTypes payload = 2;
|
|
|
|
map<string, int64> map_string_to_int64 = 3;
|
|
}
|
|
|
|
message ForeignMessage {
|
|
int32 c = 1;
|
|
}
|
|
|
|
enum ForeignEnum {
|
|
FOREIGN_ZERO = 0;
|
|
FOREIGN_FOO = 4;
|
|
FOREIGN_BAR = 5;
|
|
FOREIGN_BAZ = 6;
|
|
}
|
|
|
|
message TestEmptyMessage {
|
|
}
|