forked from apache/mxnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NativeResource Management in Scala (apache#12647)
* add Generic MXNetHandle trait and MXNetHandlePhantomRef class that will be used by all MXNetObjects * Generic Handle with AutoCloseable * add NativeResource and NativeResourceManager with Periodic GC calling * use NativeResource trait in NDArray, Symbol and Executor * add run train mnist script * create a Generic ResourceScope that can collect all NativeResources to dispose at the end * modify NativeResource and ResourceScope, extend NativeResource in NDArray, Symbol and Executor * remove GCExecutor * deRegister PhantomReferences by when calling dispose() * add Finalizer(temporary) to NativeResource * refactor NativeResource.dispose() method * update NativeResource/add Unit Test for NativeResource * updates to NativeResource/NativeResourceRef and unit tests to NativeResource * remove redundant code added because of the object equality that was needed * add ResourceScope * Fix NativeResource to not remove from Scope, add Unit Tests to ResourceScope * cleanup log/print debug statements * use TreeSet inplace of ArrayBuffer to speedup removal of resources from ResourceScope Fix Executor dispose and make KVStore a NativeResource * fix segfault that was happening because of NDArray creation on the fly in Optimizer * Add comments for dispose(param:Boolean)
- Loading branch information
Showing
14 changed files
with
778 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.