You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prevent input tensors from being GC'ed before PInvoke occurs (migueldeicaza#335)
We were seeing test failures because GC would occur after tensor handles were copied
to IntPtr array but before PInvoke finished. GC would run the finalizer, which freed
the native tensors, while TF was still running.
Prevent the GC from finalizing these by telling it we're still using the managed object.
There may be more instances of this problem with other types. The generic pattern to search for
is a manged object with a finalizer that exposes its native state (like TFDisposable), and that native
state is used after the last reference to the managed object in the method and no external
reference is guaranteed.
0 commit comments