releaseEncoder method
Releases the retained encoder now and keeps the parsed snapshots, so a host can free the model's memory without losing them. Operations that use the encoder finish with it; it is disposed once they have, and the next operation that needs an encoder opens one again. Completes once the encoder is disposed, with the error its disposal threw, if any. Does nothing when no encoder is retained, such as without retainEncoder; an encoder still opening is kept.
Implementation
Future<void> releaseEncoder() async {
final retained = _retained;
if (retained == null) return;
_evict(retained);
await retained.disposed;
}