MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetSwitchPredicate

Function GetSwitchPredicate

tensorflow/compiler/tf2xla/functionalize_cond.cc:120–130  ·  view source on GitHub ↗

Returns the predicate of a switch.

Source from the content-addressed store, hash-verified

118
119// Returns the predicate of a switch.
120Status 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
132Status GetSwitchValue(const Node& switch_node, OutputTensor* val) {
133 const Edge* val_edge;

Callers 4

AddSwitchMethod · 0.85
StateAlongEdgeMethod · 0.85
RemoveRedundantSwitchMethod · 0.85

Calls 5

input_edgeMethod · 0.80
IsIdentityMethod · 0.80
OutputTensorClass · 0.50
srcMethod · 0.45
src_outputMethod · 0.45

Tested by

no test coverage detected