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

Method UpdateBuilder

tensorflow/cc/framework/scope.cc:326–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326void Scope::UpdateBuilder(NodeBuilder* builder) const {
327 std::vector<Node*> control_inputs;
328 for (const auto& op : impl()->control_deps_) {
329 control_inputs.push_back(op.node());
330 }
331 builder->ControlInputs(control_inputs);
332
333 if (!impl()->kernel_label_.empty()) {
334 builder->Attr("_kernel", impl()->kernel_label_);
335 }
336
337 if (!impl()->colocation_constraints_.empty()) {
338 std::vector<string> constraints(impl()->colocation_constraints_.begin(),
339 impl()->colocation_constraints_.end());
340 // Sort the set.
341 std::sort(constraints.begin(), constraints.end());
342 // Add loc:@ prefix
343 std::transform(constraints.begin(), constraints.end(), constraints.begin(),
344 [](const string& s) {
345 return strings::StrCat(kColocationGroupPrefix, s);
346 });
347 builder->Attr(kColocationAttrName, constraints);
348 }
349 if (!impl()->device_.empty()) {
350 builder->Device(impl()->device_);
351 }
352 if (!impl()->assigned_device_.empty()) {
353 builder->AssignedDevice(impl()->assigned_device_);
354 }
355 if (!impl()->xla_cluster_.empty()) {
356 builder->XlaCluster(impl()->xla_cluster_);
357 }
358}
359
360string Scope::Impl::GetUniqueName(const string& prefix,
361 bool check_single_use) const {

Callers 15

DummyReadResourceCCMethod · 0.80
CreateSwitchNFunction · 0.80
CreateTestVariantMethod · 0.80
CreateConcatV1OpFunction · 0.80
BuildPlaceHolderOpFunction · 0.80
BuildAddOpMethod · 0.80
BuildFusedGraphDefMethod · 0.80
BuildAddOpsFunction · 0.80
BuildSoftmaxOpsFunction · 0.80
BuildConv2DOpsFunction · 0.80
BuildMaxPoolOpsFunction · 0.80

Calls 10

sortFunction · 0.85
transformFunction · 0.50
StrCatFunction · 0.50
push_backMethod · 0.45
nodeMethod · 0.45
emptyMethod · 0.45
AttrMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
DeviceMethod · 0.45

Tested by 13

DummyReadResourceCCMethod · 0.64
CreateSwitchNFunction · 0.64
CreateTestVariantMethod · 0.64
CreateConcatV1OpFunction · 0.64
BuildPlaceHolderOpFunction · 0.64
BuildAddOpMethod · 0.64
BuildAddOpsFunction · 0.64
BuildSoftmaxOpsFunction · 0.64
BuildConv2DOpsFunction · 0.64
BuildMaxPoolOpsFunction · 0.64
ConstructOpFunction · 0.64