resetVariableTensors method

void resetVariableTensors()

Sets every variable tensor to zero (an int8 tensor to its quantization zero point), the same state allocateTensors leaves them in.

This does not restore values from the .tflite file: LiteRT's TfLiteInterpreterResetVariableTensors only zeroes the memory. To get the model's values back, close this interpreter and create a new one from the model.

Implementation

void resetVariableTensors() {
  checkState(
    !_deleted,
    message: 'Should not access interpreter after it has been closed.',
  );
  tfliteBinding.TfLiteInterpreterResetVariableTensors(_interpreter);
}