| 18 | namespace tensorflow { |
| 19 | |
| 20 | WhileContext::WhileContext(StringPiece frame_name, |
| 21 | std::vector<Node*> enter_nodes, |
| 22 | std::vector<Node*> exit_nodes, |
| 23 | OutputTensor cond_output, |
| 24 | std::vector<OutputTensor> body_inputs, |
| 25 | std::vector<OutputTensor> body_outputs) |
| 26 | : frame_name_(frame_name), |
| 27 | enter_nodes_(std::move(enter_nodes)), |
| 28 | exit_nodes_(std::move(exit_nodes)), |
| 29 | cond_output_(cond_output), |
| 30 | body_inputs_(std::move(body_inputs)), |
| 31 | body_outputs_(std::move(body_outputs)) { |
| 32 | const size_t num_loop_vars = enter_nodes_.size(); |
| 33 | DCHECK_EQ(exit_nodes_.size(), num_loop_vars); |
| 34 | DCHECK_EQ(body_inputs_.size(), num_loop_vars); |
| 35 | DCHECK_EQ(body_outputs_.size(), num_loop_vars); |
| 36 | } |
| 37 | |
| 38 | } // namespace tensorflow |