Returns the predicate of a switch.
| 118 | |
| 119 | // Returns the predicate of a switch. |
| 120 | Status GetSwitchPredicate(const Node& switch_node, OutputTensor* pred) { |
| 121 | const Edge* pred_edge; |
| 122 | TF_RETURN_IF_ERROR(switch_node.input_edge(1, &pred_edge)); |
| 123 | // The predicate can be preceded by a identity node. Look through |
| 124 | // identity nodes to predicate. |
| 125 | while (pred_edge->src()->IsIdentity()) { |
| 126 | TF_RETURN_IF_ERROR(pred_edge->src()->input_edge(0, &pred_edge)); |
| 127 | } |
| 128 | *pred = OutputTensor(pred_edge->src(), pred_edge->src_output()); |
| 129 | return Status::OK(); |
| 130 | } |
| 131 | |
| 132 | Status GetSwitchValue(const Node& switch_node, OutputTensor* val) { |
| 133 | const Edge* val_edge; |
no test coverage detected