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

Method RemoveUnusedComputations

tensorflow/compiler/xla/service/hlo_module.cc:671–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

669}
670
671Status HloModule::RemoveUnusedComputations() {
672 std::string suffix = "tmp";
673 auto module = absl::make_unique<HloModule>(
674 absl::StrCat(name_, suffix.empty() ? "" : "-", suffix), config());
675 HloCloneContext context(module.get(), suffix);
676 entry_computation_->Clone(suffix, &context);
677 std::vector<HloComputation*> to_remove;
678 for (auto computation : computations()) {
679 auto found_computation = context.FindComputation(computation);
680 if (found_computation == nullptr) {
681 to_remove.push_back(computation);
682 }
683 }
684 for (auto computation : to_remove) {
685 TF_RETURN_IF_ERROR(RemoveEmbeddedComputation(computation));
686 }
687 return Status::OK();
688}
689
690HloComputation* HloModule::DeepCloneComputation(HloComputation* computation,
691 HloCloneContext* context) {

Callers

nothing calls this directly

Calls 6

StrCatFunction · 0.50
emptyMethod · 0.45
getMethod · 0.45
CloneMethod · 0.45
FindComputationMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected