Update tensorflow/core/profiler/convert/xplane_to_memory_profile.cc

Co-authored-by: Mihai Maruseac <mihai.maruseac@gmail.com>
This commit is contained in:
tg-at-google 2020-07-28 20:58:19 -04:00 committed by GitHub
parent 53de2cff12
commit 5bbedc7ec0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -413,8 +413,8 @@ void ProcessActiveAllocations(int64 peak_bytes_profile_step_id,
allocation->set_special_index(-1);
}
allocation->set_num_occurrences(1);
const int active_allocs_size = active_allocs.size() - 1;
while (i < active_allocs_size &&
const int last_alloc = active_allocs.size() - 1;
while (i < last_alloc &&
active_allocs[i] == active_allocs[i + 1]) {
allocation->set_num_occurrences(allocation->num_occurrences() + 1);
i++;