Skip to content

Commit

Permalink
Rename all titled Java* (apache#3)
Browse files Browse the repository at this point in the history
* renameed...

* fix spaces
  • Loading branch information
lanking520 authored and andrewfayres committed Oct 5, 2018
1 parent 33bbb87 commit 3861a90
Show file tree
Hide file tree
Showing 7 changed files with 233 additions and 235 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.mxnet.api.java
package org.apache.mxnet.javaapi

import org.apache.mxnet.Context

class JavaContext(val context: Context) {
class Context(val context: org.apache.mxnet.Context) {
val deviceTypeid: Int = context.deviceTypeid

def this(deviceTypeName: String, deviceId: Int = 0)
= this(new Context(deviceTypeName, deviceId))
= this(new org.apache.mxnet.Context(deviceTypeName, deviceId))

def withScope[T](body: => T): T = context.withScope(body)
def deviceType: String = context.deviceType
Expand All @@ -33,8 +31,8 @@ class JavaContext(val context: Context) {
}


object JavaContext {
implicit def fromContext(context: Context): JavaContext = new JavaContext(context)
object Context {
implicit def fromContext(context: org.apache.mxnet.Context): Context = new Context(context)

implicit def toContext(jContext: JavaContext): Context = jContext.context
implicit def toContext(jContext: Context): org.apache.mxnet.Context = jContext.context
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.mxnet.api.java
package org.apache.mxnet.javaapi

import org.apache.mxnet.DType

object JavaDType extends Enumeration {
type DType = DType.DType
val Float32 = DType.Float32
val Float64 = DType.Float64
val Float16 = DType.Float16
val UInt8 = DType.UInt8
val Int32 = DType.Int32
val Unknown = DType.Unknown
object DType extends Enumeration {
type DType = org.apache.mxnet.DType.DType
val Float32 = org.apache.mxnet.DType.Float32
val Float64 = org.apache.mxnet.DType.Float64
val Float16 = org.apache.mxnet.DType.Float16
val UInt8 = org.apache.mxnet.DType.UInt8
val Int32 = org.apache.mxnet.DType.Int32
val Unknown = org.apache.mxnet.DType.Unknown

private[mxnet] def numOfBytes(dType: DType): Int = DType.numOfBytes(dType)
private[mxnet] def numOfBytes(dType: DType): Int = org.apache.mxnet.DType.numOfBytes(dType)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,18 @@
* limitations under the License.
*/

package org.apache.mxnet.api.java
package org.apache.mxnet.javaapi

import org.apache.mxnet.DataDesc
import org.apache.mxnet.Shape
class DataDesc(val dataDesc: org.apache.mxnet.DataDesc) {

class JavaDataDesc(val dataDesc: DataDesc) {

def this(name: String, shape: Shape, dType: JavaDType.DType, layout: String) =
this(new DataDesc(name, shape, dType, layout))
def this(name: String, shape: Shape, dType: DType.DType, layout: String) =
this(new org.apache.mxnet.DataDesc(name, shape, dType, layout))

override def toString(): String = dataDesc.toString()
}

object JavaDataDesc{
implicit def fromDataDesc(dataDesc: DataDesc): JavaDataDesc = new JavaDataDesc(dataDesc)
object DataDesc{
implicit def fromDataDesc(dataDesc: org.apache.mxnet.DataDesc): DataDesc = new DataDesc(dataDesc)

implicit def toDataDesc(dataDesc: JavaDataDesc): DataDesc = dataDesc.dataDesc
implicit def toDataDesc(dataDesc: DataDesc): org.apache.mxnet.DataDesc = dataDesc.dataDesc
}
Loading

0 comments on commit 3861a90

Please sign in to comment.