Class OnnxSessionLease
A borrowed session. Dispose() releases the lease; the underlying InferenceSession is disposed only when the last lease returns after a drop.
public sealed class OnnxSessionLease : IDisposable
- Inheritance
-
OnnxSessionLease
- Implements
- Inherited Members
Remarks
InferenceSession has a finalizer, so a dropped-but-undisposed session pins the
entire native graph until GC - jetsam bait on iOS - while disposing one under an in-flight
Run is a native access violation. The lease is what makes both impossible.
Properties
- Info
The session's facts as of the moment the lease was taken.
- Session
The borrowed session. Valid until this lease is disposed, and not one moment after.
Methods
- Dispose()
Returns the lease. Idempotent.