Open lijianxin520 opened 3 years ago
To my experience, problems like these can be avoided if you do not access an instance of ndarray from different threads or tasks. If it is still necessary, try copying ndarray to float[], pass it to your method and then copy to new ndarray. Cheers!
I'm single-threaded, so I shouldn't have any problems with multithreading
To my understanding - AccessViolationException
usually occurs if you somehow lost reference to your NDArray
.
NDArray
only frees allocated memory when IDisposable
is triggered by the garbage collector when there are no longer any references to it.
In addition, zero-copied NDArray
s from any operation still hold a reference to base memory which should prevent deallocation.
Please provide here a reproducing unit test/piece of code and I'll gladly investigate.
这个是我测试的时候异常的内容, 当我对一个数组执行批处理操作时,我看到的结果是这个问题.
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.