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

Method ApplySetOperation

tensorflow/core/kernels/set_kernels.cc:429–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427
428template <typename T>
429void SetOperationOp<T>::ApplySetOperation(const std::set<T>& set1,
430 const std::set<T>& set2,
431 std::set<T>* result) const {
432 switch (set_operation_) {
433 case A_MINUS_B:
434 std::set_difference(set1.begin(), set1.end(), set2.begin(), set2.end(),
435 std::inserter(*result, result->begin()));
436 break;
437 case B_MINUS_A:
438 std::set_difference(set2.begin(), set2.end(), set1.begin(), set1.end(),
439 std::inserter(*result, result->begin()));
440 break;
441 case INTERSECTION:
442 std::set_intersection(set1.begin(), set1.end(), set2.begin(), set2.end(),
443 std::inserter(*result, result->begin()));
444 break;
445 case UNION:
446 std::set_union(set1.begin(), set1.end(), set2.begin(), set2.end(),
447 std::inserter(*result, result->begin()));
448 break;
449 }
450}
451
452template <typename T>
453void SetDifference(const std::unordered_set<T>& set1,

Callers

nothing calls this directly

Calls 5

set_differenceFunction · 0.85
set_intersectionFunction · 0.85
set_unionFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected