Commit bcd616a6 authored by Amy Zhuang's avatar Amy Zhuang Committed by Robert Kimball

Fix a bug in offset calculation. (#2600)

parent 5b15c6b7
...@@ -107,7 +107,6 @@ void runtime::cpu::pass::CPUMemoryAssignment::process_in_place_concat( ...@@ -107,7 +107,6 @@ void runtime::cpu::pass::CPUMemoryAssignment::process_in_place_concat(
NGRAPH_DEBUG NGRAPH_DEBUG
<< "cpu_memory_assignment: change offset, old offset is " << "cpu_memory_assignment: change offset, old offset is "
<< old_offset << ", new offset is " << offset << std::endl; << old_offset << ", new offset is " << offset << std::endl;
offset += input_tensor->size();
// check if need to propagate backward // check if need to propagate backward
if (arg->is_op()) if (arg->is_op())
...@@ -129,6 +128,7 @@ void runtime::cpu::pass::CPUMemoryAssignment::process_in_place_concat( ...@@ -129,6 +128,7 @@ void runtime::cpu::pass::CPUMemoryAssignment::process_in_place_concat(
} }
} }
} }
offset += input_tensor->size();
arg_index++; arg_index++;
} }
} }
...@@ -159,7 +159,6 @@ void runtime::cpu::pass::CPUMemoryAssignment::propagate_in_place_concat( ...@@ -159,7 +159,6 @@ void runtime::cpu::pass::CPUMemoryAssignment::propagate_in_place_concat(
input_tensor->set_pool_offset(offset); input_tensor->set_pool_offset(offset);
NGRAPH_DEBUG << "cpu_memory_assignment: change offset, old offset is " << old_offset NGRAPH_DEBUG << "cpu_memory_assignment: change offset, old offset is " << old_offset
<< ", new offset is " << offset; << ", new offset is " << offset;
offset += input_tensor->size();
// check if need to propagate backward // check if need to propagate backward
if (arg->is_op()) if (arg->is_op())
...@@ -180,6 +179,7 @@ void runtime::cpu::pass::CPUMemoryAssignment::propagate_in_place_concat( ...@@ -180,6 +179,7 @@ void runtime::cpu::pass::CPUMemoryAssignment::propagate_in_place_concat(
} }
} }
} }
offset += input_tensor->size();
arg_index++; arg_index++;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment