Skip to content

Commit

Permalink
Support setting core number from python side (intel-analytics#1509)
Browse files Browse the repository at this point in the history
* support set core num

* fix session_config

* fix license

* address comments
  • Loading branch information
yangw1234 committed Jul 15, 2019
1 parent 7a64fd6 commit 211b3a8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions layers/utils/Reflection.scala
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ object EngineRef {
def getEngineType(): EngineType = {
KerasUtils.invokeMethod(Engine, "getEngineType").asInstanceOf[EngineType]
}

def setCoreNumber(num: Int): Unit = {
val field = Engine.getClass.getDeclaredField("physicalCoreNumber")
field.setAccessible(true)
field.setInt(Engine, num)
}
}

object SGDRef {
Expand Down

0 comments on commit 211b3a8

Please sign in to comment.