allocateTensors method

void allocateTensors()

Allocates memory for all tensors in this signature.

Must be called after Interpreter.getSignatureRunner and after any resizeInputTensor calls, before the first invoke.

Implementation

void allocateTensors() {
  checkState(!_closed, message: 'SignatureRunner is already closed.');
  checkTfLiteStatus(
    'TfLiteSignatureRunnerAllocateTensors',
    tfliteBinding.TfLiteSignatureRunnerAllocateTensors(_runner),
  );
  _allocated = true;
  // Allocation can relocate tensor structs (e.g. first-time delegate
  // application grows the tensors arena), so cached handles may dangle.
  _invalidateTensorCaches();
}