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

Method CaseBuilder

tensorflow/core/common_runtime/lower_case_op.cc:99–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97};
98
99CaseBuilder::CaseBuilder(Node* case_op,
100 const std::vector<string>& branch_fn_names,
101 bool keep_node_fetchable, Graph* graph)
102 : case_op_(case_op),
103 num_branches_(branch_fn_names.size()),
104 graph_(graph),
105 name_(case_op->name()),
106 keep_node_fetchable_(keep_node_fetchable),
107 debug_info_(*case_op_) {
108 branch_call_builders_.reserve(num_branches_);
109 for (int b = 0; b < num_branches_; b++) {
110 branch_call_builders_.emplace_back(NewName(strings::StrCat("branch", b)),
111 branch_fn_names[b], graph->op_registry(),
112 &debug_info_);
113 branch_call_builders_[b].Device(case_op_->requested_device());
114 branch_call_builders_[b].Attr(kLowerAsMultiDeviceFunctionAttr, true);
115 }
116 TF_CHECK_OK(case_op_->input_tensor(0, &branch_index_));
117}
118
119Status CaseBuilder::CreatePivotNodes() {
120 // Construct the basic case body (consisting of feeding in the val to

Callers

nothing calls this directly

Calls 10

NewNameFunction · 0.85
nameMethod · 0.65
StrCatFunction · 0.50
sizeMethod · 0.45
reserveMethod · 0.45
emplace_backMethod · 0.45
op_registryMethod · 0.45
DeviceMethod · 0.45
AttrMethod · 0.45
input_tensorMethod · 0.45

Tested by

no test coverage detected