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

Method AddIfNode

tensorflow/compiler/tf2xla/functionalize_cond.cc:944–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

942}
943
944StatusOr<Node*> FunctionalizeCond::AddIfNode(const NodeDef& def,
945 const Node* replacee,
946 const OutputTensor& predicate) {
947 Status status;
948 Node* ret = graph_->AddNode(def, &status);
949 TF_RETURN_IF_ERROR(status);
950 VLOG(1) << "Adding If for " << replacee->name();
951 StateMap::CondId id = state_map_.LookupCondId(replacee);
952 if (id) {
953 StateMap::CondState state = *id;
954 state.erase(predicate);
955 state_map_.ResetCondId(ret, state_map_.GetCondId(state));
956 } else {
957 state_map_.ResetCondId(ret, nullptr);
958 }
959
960 state_map_.ResetAncestorId(ret, state_map_.LookupAncestorId(replacee));
961
962 return ret;
963}
964
965Status FunctionalizeCond::PropagateUpdatedState(const Node* replacee) {
966 VLOG(2) << "Propagating update state for " << replacee->name() << " "

Callers 1

BuildIfNodeMethod · 0.80

Calls 8

LookupCondIdMethod · 0.80
ResetCondIdMethod · 0.80
GetCondIdMethod · 0.80
ResetAncestorIdMethod · 0.80
LookupAncestorIdMethod · 0.80
nameMethod · 0.65
AddNodeMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected