aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/proto_text/test.proto
blob: 298fc0deef896e7512762f9a953377c770389afb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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 {
}