andrewfayres commented on a change in pull request #12757: [MXNET-915] Java 
Inference API core wrappers and tests
URL: https://github.com/apache/incubator-mxnet/pull/12757#discussion_r223452143
 
 

 ##########
 File path: scala-package/core/src/main/scala/org/apache/mxnet/javaapi/IO.scala
 ##########
 @@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mxnet.javaapi
+
+class DataDesc(val dataDesc: org.apache.mxnet.DataDesc) {
+
+  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 DataDesc{
+  implicit def fromDataDesc(dDesc: org.apache.mxnet.DataDesc): DataDesc = new 
DataDesc(dDesc)
 
 Review comment:
   double checked this. When making them private the conversions don't work 
properly when used in other classes. For example, the dataDesc constructor 
takes in a javaapi.shape and converts it to a mxnet.shape.
   
   One possible alternative would be to make the conversion implicit private 
and also provide a conversion method which could be explicitly called from 
outside the class. I haven't tried this so I'm not 100% sure it'd work. It'd be 
a little bit of a hassle to use elsewhere in the code but not much.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to