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

Method GetColocationConstraints

tensorflow/cc/framework/scope.cc:270–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268 disable_shape_inference_(other.impl()->disable_shape_inference_) {}
269
270std::unordered_set<string> Scope::Impl::GetColocationConstraints(
271 const Operation& colocate_with_op) const {
272 std::unordered_set<string> current_constraints(colocation_constraints_);
273 const AttrSlice attrs = colocate_with_op.node()->attrs();
274 std::vector<string> node_constraints;
275 if (TryGetNodeAttr(attrs, kColocationAttrName, &node_constraints)) {
276 for (const string& entry : node_constraints) {
277 StringPiece s(entry);
278 if (absl::ConsumePrefix(&s, kColocationGroupPrefix)) {
279 current_constraints.emplace(s);
280 }
281 }
282 } else {
283 current_constraints.insert(colocate_with_op.node()->name());
284 }
285 return current_constraints;
286}
287
288bool Scope::ok() const { return impl()->status_->ok(); }
289

Callers 1

ImplMethod · 0.80

Calls 6

nameMethod · 0.65
ConsumePrefixFunction · 0.50
attrsMethod · 0.45
nodeMethod · 0.45
emplaceMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected