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

Method CreatePivotNodes

tensorflow/core/common_runtime/lower_if_op.cc:130–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130Status CondBuilder::CreatePivotNodes() {
131 // Construct the basic cond body (consisting of feeding in the predicate to
132 // create pivot nodes).
133 Node* switch_pred;
134 TF_RETURN_IF_ERROR(NodeBuilder(NewName("switch_pred"), "Switch",
135 graph_->op_registry(), &debug_info_)
136 .Input(NodeOut(pred_))
137 .Input(NodeOut(pred_))
138 .Device(if_op_->requested_device())
139 .Finalize(graph_, &switch_pred));
140 control_predecessor_ = switch_pred;
141 TF_RETURN_IF_ERROR(NodeBuilder(NewName("pivot_f"), "Identity",
142 graph_->op_registry(), &debug_info_)
143 .Input(switch_pred, kElseBranch)
144 .Device(if_op_->requested_device())
145 .Finalize(graph_, &pivot_f_));
146 TF_RETURN_IF_ERROR(NodeBuilder(NewName("pivot_t"), "Identity",
147 graph_->op_registry(), &debug_info_)
148 .Input(switch_pred, kThenBranch)
149 .Device(if_op_->requested_device())
150 .Finalize(graph_, &pivot_t_));
151 return Status::OK();
152}
153
154string CondBuilder::NewName(const string& infix) {
155 return graph_->NewName(strings::StrCat(name_, "/", infix));

Callers 1

RewriteIfNodeFunction · 0.45

Calls 7

NewNameFunction · 0.85
NodeBuilderClass · 0.50
NodeOutClass · 0.50
FinalizeMethod · 0.45
DeviceMethod · 0.45
InputMethod · 0.45
op_registryMethod · 0.45

Tested by

no test coverage detected