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