void DynamicTensorManager::planDealloc(ir::OperationIndex op_ind, ir::OperandIndex operand_ind)
{
- auto find = _dealloc_tensor_map.find(op_ind);
- if (find != _dealloc_tensor_map.end())
- {
- auto &input_set = find->second;
- input_set.emplace(operand_ind);
- }
- else
- {
- _dealloc_tensor_map.emplace(
- std::make_pair(op_ind, std::unordered_set<ir::OperandIndex>{operand_ind}));
- }
+ _dealloc_tensor_map[op_ind].emplace(operand_ind);
}
void DynamicTensorManager::deallocInput(ir::OperationIndex op_ind)
* @todo DynamicMemoryManager is not optimized. Optimized one is needed
*/
std::shared_ptr<cpu_common::DynamicMemoryManager> _dynamic_mem_mgr;
- // TODO Refactoring : Merge two TensorRegistries into one
const std::shared_ptr<TensorRegistry> _tensors;
// contains list of dynamic tensor index, which can be deallocated after running operation
void DynamicTensorManager::planDealloc(ir::OperationIndex op_ind, ir::OperandIndex operand_ind)
{
- auto find = _dealloc_tensor_map.find(op_ind);
- if (find != _dealloc_tensor_map.end())
- {
- auto &input_set = find->second;
- input_set.emplace(operand_ind);
- }
- else
- {
- _dealloc_tensor_map.emplace(
- std::make_pair(op_ind, std::unordered_set<ir::OperandIndex>{operand_ind}));
- }
+ _dealloc_tensor_map[op_ind].emplace(operand_ind);
}
void DynamicTensorManager::deallocInput(ir::OperationIndex op_ind)