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

Method AddSwitch

tensorflow/compiler/tf2xla/functionalize_cond.cc:386–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384}
385
386Status Conditional::AddSwitch(Node* s) {
387 VLOG(5) << "Adding switch " << s->DebugString();
388 OutputTensor predicate;
389 TF_RETURN_IF_ERROR(GetSwitchPredicate(*s, &predicate));
390 if (switch_predicate_.node == nullptr) switch_predicate_ = predicate;
391 if (!(switch_predicate_ == predicate)) {
392 return errors::InvalidArgument(
393 "Merge nodes ", NodesToString(merges_),
394 " directly dominated by switch nodes with different predicates (",
395 DebugString(switch_predicate_), " vs ", DebugString(predicate), ").");
396 }
397 switches_.insert(s);
398 parent_->AddSwitchId(s->id());
399 return Status::OK();
400}
401
402Status Conditional::BuildArgumentNodes() {
403 VLOG(1) << "Build function arguments";

Callers

nothing calls this directly

Calls 8

GetSwitchPredicateFunction · 0.85
InvalidArgumentFunction · 0.85
NodesToStringFunction · 0.85
AddSwitchIdMethod · 0.80
DebugStringFunction · 0.70
DebugStringMethod · 0.45
insertMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected