• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1syntax = "proto3";
2
3package tensorflow;
4option cc_enable_arenas = true;
5option java_outer_classname = "ControlFlowProtos";
6option java_multiple_files = true;
7option java_package = "org.tensorflow.framework";
8option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
9
10// Control flow context related protocol buffers.
11
12// Protocol buffer representing the values in ControlFlowContext.
13message ValuesDef {
14  // Value names that have been seen in this context.
15  repeated string values = 1;
16
17  // Value names referenced by but external to this context.
18  map<string, string> external_values = 2;
19}
20
21// Container for any kind of control flow context. Any other control flow
22// contexts that are added below should also be added here.
23message ControlFlowContextDef {
24  oneof ctxt {
25    CondContextDef cond_ctxt = 1;
26    WhileContextDef while_ctxt = 2;
27  }
28}
29
30// Protocol buffer representing a CondContext object.
31message CondContextDef {
32  // Name of the context.
33  string context_name = 1;
34
35  // Name of the pred tensor.
36  string pred_name = 2;
37
38  // Name of the pivot tensor.
39  string pivot_name = 3;
40
41  // Branch prediction. 0 or 1.
42  int32 branch = 4;
43
44  // Values and external values in control flow context.
45  ValuesDef values_def = 5;
46
47  // Contexts contained inside this context (e.g. nested conds).
48  repeated ControlFlowContextDef nested_contexts = 6;
49}
50
51// Protocol buffer representing a WhileContext object.
52message WhileContextDef {
53  // Name of the context.
54  string context_name = 1;
55
56  // The number of iterations allowed to run in parallel.
57  int32 parallel_iterations = 2;
58
59  // Whether backprop is enabled for this while loop.
60  bool back_prop = 3;
61
62  // Whether GPU-CPU memory swap is enabled for this loop.
63  bool swap_memory = 4;
64
65  // Name of the pivot tensor.
66  string pivot_name = 5;
67
68  // Name of the pivot_for_pred tensor.
69  string pivot_for_pred_name = 6;
70
71  // Name of the pivot_for_body tensor.
72  string pivot_for_body_name = 7;
73
74  // List of names for exit tensors.
75  repeated string loop_exit_names = 8;
76
77  // List of names for enter tensors.
78  repeated string loop_enter_names = 10;
79
80  // Values and external values in control flow context.
81  ValuesDef values_def = 9;
82
83  // Optional name of the maximum_iterations tensor.
84  string maximum_iterations_name = 11;
85
86  // Contexts contained inside this context (e.g. nested whiles).
87  repeated ControlFlowContextDef nested_contexts = 12;
88
89  // Next available id: 13.
90}
91