Skip to content

Commit

Permalink
[onert] Implement notifyLastUse in training TensorBuilder
Browse files Browse the repository at this point in the history
This commit add implementation of the notifyLastUse function in the TensorBuilder for training.

ONE-DCO-1.0-Signed-off-by: ragmani <[email protected]>
  • Loading branch information
ragmani committed Jul 29, 2024
1 parent 19b0b2b commit 2740e4e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions runtime/onert/backend/train/TensorBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,16 @@ void TensorBuilder::notifyFirstUse(const ir::OperandIndex &index)
}
}

void TensorBuilder::notifyLastUse(const ir::OperandIndex &)
void TensorBuilder::notifyLastUse(const ir::OperandIndex &index)
{
// TODO Support momory plan
if (_as_constants[index])
{
_tensor_mgr->releaseTrainablePlan(index);
}
else
{
_tensor_mgr->releaseNonConstPlan(index);
}
}

void TensorBuilder::notifyBackwardFirstUse(const ir::OperandIndex &index)
Expand Down

0 comments on commit 2740e4e

Please sign in to comment.