Skip to content

Commit

Permalink
Use explicit capture for lambda.
Browse files Browse the repository at this point in the history
It seems we cannot implicitly capture the temporary loop variable, it causes a
compile error with Clang 14.

PiperOrigin-RevId: 609322836
  • Loading branch information
akuegel authored and tensorflower-gardener committed Feb 22, 2024
1 parent 32c5deb commit 78129e3
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -148,9 +148,10 @@ PartitionedComputation::PartitionedComputation(
std::vector<const HloInstruction*> roots;
for (auto* instruction : instructions) {
if (instruction->user_count() == 0 ||
absl::c_any_of(instruction->users(), [&](auto* user) {
return disjoint_sets[user].Get() != cluster_id;
})) {
absl::c_any_of(instruction->users(),
[cluster_id = cluster_id, &disjoint_sets](auto* user) {
return disjoint_sets[user].Get() != cluster_id;
})) {
roots.push_back(instruction);
}
}
Expand Down

0 comments on commit 78129e3

Please sign in to comment.