Skip to content

Commit

Permalink
minor improvement.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfbalin committed Jul 8, 2024
1 parent fb8eaf8 commit 5247dab
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions graphbolt/src/cache_policy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@ torch::Tensor BaseCachePolicy::ReplaceImpl(
for (int64_t i = 0; i < keys.size(0); i++) {
const auto key = keys_ptr[i];
const auto pos = policy.Read(key);
if (pos.has_value()) { // Already in the cache, inc freq.
positions_ptr[i] = *pos;
} else {
positions_ptr[i] = policy.Insert(key);
}
positions_ptr[i] = pos.has_value() ? *pos : policy.Insert(key);
}
}));
return positions;
Expand Down

0 comments on commit 5247dab

Please sign in to comment.