Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion onnxruntime/core/framework/allocation_planner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ class PlannerImpl {
if (node_output->Exists()) {
MLValueIndex index = Index(node_output->Name());
ProcessDef(index, node_output);
++UseCount(index);
if (strcmp(default_allocator_info.name, CPU) != 0) {
// By default, outputs of this node are allocated on the default device allocator,
// except for outputs marked for allocation in MemoryType:
Expand Down Expand Up @@ -528,7 +529,7 @@ class PlannerImpl {
if (node_output->Exists()) {
auto& sym = node_output->Name();
auto original = Buffer(Index(sym));
if (0 == UseCount(original))
if (0 == --UseCount(original))
freelist_.push_front(FreeBufferInfo(original, program_counter));
}
}
Expand Down