This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to cleanly deallocate Arm NN output tensors

Hello everyone,

When I am initializing my Arm NN, I am pre-allocating output tensors like this:

//pre-allocate memory for output
for (int it = 0; it < outputLayerNamesList.size(); ++it)
    const armnn::DataType dataType = outputBindingInfo[it].second.GetDataType();
    const armnn::TensorShape& tensorShape = outputBindingInfo[it].second.GetShape();
    std::vector<float> oneLayerOutResult;

    oneLayerOutResult.resize(tensorShape.GetNumElements(), 0);

    // Make ArmNN output tensors
    for (std::size_t it = 0; it < outputBuffer.size(); ++it)
            outputBindingInfo[it].first, armnn::Tensor(outputBindingInfo[it].second,;

The question is:  What do I need to do to cleanly deallocate these output tensors when I am done with the network?  Any suggestions, please?