Since these two loops are independent and loop over the same
tensor_builders, better to merge them
Signed-off-by: Poshshoev Dilshodzhon <d.poshshoev@samsung.com>
void PlanBuilder::finalize(const backend::TensorBuilderSet &tensor_builders)
{
+ auto &operands = _plan.operands();
+
// Prepare tensors
for (auto &tensor_builder : tensor_builders)
{
tensor_builder->prepare();
- }
- // Wrap tensors as Object and store them to plan
- auto &operands = _plan.operands();
- for (auto &tensor_builder : tensor_builders)
- {
+ // Wrap tensors as Object and store them to plan
tensor_builder->iterate([&](const model::operand::Index &index) {
auto object = tensor_builder->wrapTensor(index);
operands.set(index, object);