You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2021/07/20 13:33:06 UTC

[GitHub] [incubator-mxnet] channel960608 opened a new pull request #20461: Jave2.0 proto

channel960608 opened a new pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461


   ## Description ##
   A draft implement of java front-end for MXNet 2.0 refer to DeepJavaLibrary
   
   ## Checklist ##
   ### Essentials ###
   - [FEATHER] load MXNet binary library
   - [FEATHER] add required components of MXNet: Symbol, NDArray and CachedOP
   - [FEATHER] implement simple inference using the components above
   
   ### Changes ###
   none
   
   ## Comments ##
   none
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20461: Jave2.0 proto

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-883396318


   Hey @channel960608 , Thanks for submitting the PR 
   All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands: 
   - To trigger all jobs: @mxnet-bot run ci [all] 
   - To trigger specific jobs: @mxnet-bot run ci [job1, job2] 
   *** 
   **CI supported jobs**: [centos-cpu, clang, miscellaneous, sanity, unix-gpu, centos-gpu, website, windows-cpu, unix-cpu, windows-gpu, edge]
   *** 
   _Note_: 
    Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin. 
   All CI tests must pass before the PR can be merged. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] channel960608 commented on pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
channel960608 commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-927161240


   > Is now a good time to review?
   
   sure


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 commented on pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-909400301


   @barry-jin could you check why RAT check failed? https://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fsanity/detail/PR-20461/11/pipeline/40


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 commented on a change in pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r699481157



##########
File path: java-package/integration/src/main/java/org/apache/mxnet/integration/tests/engine/ModelTest.java
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.integration.tests.engine;
+
+import java.io.IOException;
+import org.apache.mxnet.engine.BaseMxResource;
+import org.apache.mxnet.engine.Model;
+import org.apache.mxnet.engine.MxResource;
+import org.apache.mxnet.engine.Predictor;
+import org.apache.mxnet.integration.tests.jna.JnaUtilTest;
+import org.apache.mxnet.integration.util.Assertions;
+import org.apache.mxnet.ndarray.NDArray;
+import org.apache.mxnet.ndarray.NDList;
+import org.apache.mxnet.ndarray.types.Shape;
+import org.apache.mxnet.repository.Item;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.Test;
+
+public class ModelTest {
+    private static final Logger logger = LoggerFactory.getLogger(JnaUtilTest.class);
+
+    @Test
+    public void modelLoadAndPredictTest() {
+        try (MxResource base = BaseMxResource.getSystemMxResource()) {
+            Model model = Model.loadModel(Item.MLP);
+            //            Model model = Model.loadModel("test",

Review comment:
       remove comments

##########
File path: docker/dev/docker_run.sh
##########
@@ -0,0 +1,44 @@
+#

Review comment:
       put to Java-package folder

##########
File path: java-package/native/src/main/resources/META-INF/backport.txt
##########
@@ -0,0 +1,2 @@
+The file is based off Apache MXNet 1.7 branch (https://github.com/apache/incubator-mxnet/commit/7a84fe11dd7399d1c2bdd0fb679c46af69e48861)

Review comment:
       check what does this line do

##########
File path: src/initialize.cc
##########
@@ -373,7 +373,18 @@ std::shared_ptr<void(int)> HANDLER_NAME(                             \
       }                                                              \
     }                                                                \
   }),                                                                \
-  [](auto f) { signal(SIGNAL, f); });
+  [](auto f) {                                                       \

Review comment:
       add a comment above and tell why you make this change

##########
File path: java-package/mxnet-engine/src/main/java/org/apache/mxnet/engine/GradReq.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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.engine;
+
+/** An enum that indicates whether gradient is required. */
+public enum GradReq {

Review comment:
       Check the usage of this class. Not sure this is being used

##########
File path: java-package/mxnet-engine/src/main/java/org/apache/mxnet/ndarray/types/SparseNDArray.java
##########
@@ -0,0 +1,33 @@
+/*
+ * 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.ndarray.types;
+
+import com.sun.jna.Pointer;
+import org.apache.mxnet.ndarray.NDArray;
+
+/**
+ * An interface representing a Sparse NDArray.
+ *
+ * @see SparseFormat
+ * @see <a href="https://software.intel.com/en-us/node/471374">Sparse Matrix Storage Formats</a>
+ */
+public class SparseNDArray extends NDArray {

Review comment:
       Consider remove

##########
File path: java-package/mxnet-engine/src/main/java/org/apache/mxnet/ndarray/types/SparseFormat.java
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.ndarray.types;
+
+/**
+ * An enum representing Sparse matrix storage formats.
+ *
+ * <ul>
+ *   <li>DENSE: Stride format
+ *   <li>ROW_SPARSE: Row Sparse
+ *   <li>CSR: Compressed Sparse Row
+ * </ul>
+ *
+ * @see <a href="https://software.intel.com/en-us/node/471374">Sparse Matrix Storage Formats</a>
+ */
+public enum SparseFormat {
+    // the dense format is accelerated by MKLDNN by default
+    DENSE("default", 0),
+    ROW_SPARSE("row_sparse", 1),
+    CSR("csr", 2),
+    COO("coo", 3);

Review comment:
       We don't use COO

##########
File path: java-package/mxnet-engine/src/main/java/org/apache/mxnet/nn/Parameter.java
##########
@@ -0,0 +1,327 @@
+/*
+ * 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.nn;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.util.Objects;
+import java.util.UUID;
+import org.apache.mxnet.engine.Device;
+import org.apache.mxnet.engine.MxResource;
+import org.apache.mxnet.exception.MalformedModelException;
+import org.apache.mxnet.ndarray.NDArray;
+import org.apache.mxnet.ndarray.NDSerializer;
+import org.apache.mxnet.ndarray.types.DataType;
+import org.apache.mxnet.ndarray.types.Shape;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * {@code Parameter} is a container class that holds a learnable parameter of a model.
+ *
+ * <p>Every {@code Parameter} is associated with a {@link SymbolBlock}. The output of the block's
+ * forward function depends on the values in the {@code Parameter}. During training, the values in
+ * the {@code Parameter} are updated to reflect the training data. This process forms the crux of
+ * learning.
+ *
+ * @see <a href="https://d2l.djl.ai/chapter_deep-learning-computation/parameters.html">The D2L
+ *     chapter on parameter management</a>
+ */
+public class Parameter extends MxResource {
+    private static final Logger logger = LoggerFactory.getLogger(Parameter.class);
+
+    private static final byte VERSION = 1;
+
+    private String id;
+    private String name;
+    private Shape shape;
+    private Type type;
+    private NDArray array;
+    private boolean requiresGrad;
+
+    Parameter(Builder builder) {
+        this.id = UUID.randomUUID().toString();
+        this.name = builder.name;
+        this.shape = builder.shape;
+        this.type = builder.type;
+        this.array = builder.array;
+        this.requiresGrad = builder.requiresGrad;
+    }
+
+    /**
+     * Gets the ID of this {@code Parameter}.
+     *
+     * @return the ID of this {@code Parameter}
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Gets the name of this {@code Parameter}.
+     *
+     * @return the name of this {@code Parameter}
+     */
+    public String getName() {
+        return name == null ? "" : name;
+    }
+
+    /**
+     * Gets the type of this {@code Parameter}.
+     *
+     * @return the type of this {@code Parameter}
+     */
+    public Type getType() {
+        return type;
+    }
+
+    /**
+     * Sets the values of this {@code Parameter}.
+     *
+     * @param array the {@link NDArray} that contains values of this {@code Parameter}
+     */
+    public void setArray(NDArray array) {
+        if (shape != null) {
+            throw new IllegalStateException("array has been set! Use either setArray or setShape");
+        }
+        this.array = array;
+        shape = array.getShape();
+        array.setName(name);
+    }
+
+    /**
+     * Sets the shape of this {@code Parameter}.
+     *
+     * @param shape the shape of this {@code Parameter}
+     */
+    public void setShape(Shape shape) {
+        if (array != null) {
+            throw new IllegalStateException("array has been set! Use either setArray or setShape");
+        }
+        this.shape = shape;
+    }
+
+    /**
+     * Gets the values of this {@code Parameter} as an {@link NDArray}.
+     *
+     * @return an {@link NDArray} that contains values of this {@code Parameter}
+     */
+    public NDArray getArray() {
+        if (!isInitialized()) {
+            throw new IllegalStateException("The array has not been initialized");
+        }
+        return array;
+    }
+
+    /**
+     * Returns whether this parameter needs gradients to be computed.
+     *
+     * @return whether this parameter needs gradients to be computed
+     */
+    public boolean requiresGradient() {
+        return requiresGrad;

Review comment:
       remove this

##########
File path: java-package/integration/src/main/java/org/apache/mxnet/integration/tests/jna/JnaUtilTest.java
##########
@@ -0,0 +1,176 @@
+/*
+ * 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.integration.tests.jna;
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import org.apache.mxnet.engine.BaseMxResource;
+import org.apache.mxnet.engine.Device;
+import org.apache.mxnet.engine.MxResource;
+import org.apache.mxnet.engine.Symbol;
+import org.apache.mxnet.jna.JnaUtils;
+import org.apache.mxnet.ndarray.NDArray;
+import org.apache.mxnet.ndarray.NDList;
+import org.apache.mxnet.ndarray.types.Shape;
+import org.apache.mxnet.nn.Parameter;
+import org.apache.mxnet.nn.SymbolBlock;
+import org.apache.mxnet.repository.Item;
+import org.apache.mxnet.repository.Repository;
+import org.apache.mxnet.util.PairList;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class JnaUtilTest {
+
+    private static final Logger logger = LoggerFactory.getLogger(JnaUtilTest.class);
+
+    @Test
+    public void doForwardTest() throws IOException {
+        try (MxResource base = BaseMxResource.getSystemMxResource()) {
+            Path modelPath = Repository.initRepository(Item.MLP);
+            Path symbolPath = modelPath.resolve("mlp-symbol.json");
+            Path paramsPath = modelPath.resolve("mlp-0000.params");
+            Symbol symbol = Symbol.loadSymbol(base, symbolPath);
+            SymbolBlock block = new SymbolBlock(base, symbol);
+            Device device = Device.defaultIfNull();
+            NDList mxNDArray = JnaUtils.loadNdArray(base, paramsPath, Device.defaultIfNull(null));
+
+            // load parameters
+            List<Parameter> parameters = block.getAllParameters();
+            Map<String, Parameter> map = new ConcurrentHashMap<>();
+            parameters.forEach(p -> map.put(p.getName(), p));
+
+            for (NDArray nd : mxNDArray) {
+                String key = nd.getName();
+                if (key == null) {
+                    throw new IllegalArgumentException(
+                            "Array names must be present in parameter file");
+                }
+
+                String paramName = key.split(":", 2)[1];
+                Parameter parameter = map.remove(paramName);
+                parameter.setArray(nd);
+            }
+            block.setInputNames(new ArrayList<>(map.keySet()));
+
+            NDArray arr = NDArray.create(base, new Shape(1, 28, 28), device).ones();
+            block.forward(new NDList(arr), new PairList<>(), device);
+            logger.info(
+                    "Number of MxResource managed by baseMxResource: {}",
+                    BaseMxResource.getSystemMxResource().getSubResource().size());
+        } catch (IOException e) {
+            logger.error(e.getMessage(), e);
+            throw e;
+        }
+        Assert.assertEquals(BaseMxResource.getSystemMxResource().getSubResource().size(), 0);
+    }
+
+    @Test
+    public void createNdArray() {
+        try {
+            try (BaseMxResource base = BaseMxResource.getSystemMxResource()) {
+                int[] originIntegerArray = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
+                float[] originFloatArray = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
+                double[] originDoubleArray = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
+                long[] originLongArray = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
+                boolean[] originBooleanArray = {
+                    true, false, false, true, true, true, true, false, false, true, true, true
+                };
+                byte[] originByteArray = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
+                NDArray intArray = NDArray.create(base, originIntegerArray, new Shape(3, 4));
+                NDArray floatArray = NDArray.create(base, originFloatArray, new Shape(3, 4));
+                NDArray doubleArray = NDArray.create(base, originDoubleArray, new Shape(3, 4));
+                NDArray longArray = NDArray.create(base, originLongArray, new Shape(3, 4));
+                NDArray booleanArray = NDArray.create(base, originBooleanArray, new Shape(3, 4));
+                NDArray byteArray = NDArray.create(base, originByteArray, new Shape(3, 4));
+                NDArray intArray2 = NDArray.create(base, originIntegerArray);
+                NDArray floatArray2 = NDArray.create(base, originFloatArray);
+                NDArray doubleArray2 = NDArray.create(base, originDoubleArray);
+                NDArray longArray2 = NDArray.create(base, originLongArray);
+                NDArray booleanArray2 = NDArray.create(base, originBooleanArray);
+                NDArray byteArray2 = NDArray.create(base, originByteArray);
+
+                int[] ndArrayInt = intArray.toIntArray();
+                Assert.assertEquals(originIntegerArray, ndArrayInt);
+                // Float -> Double
+                float[] floats = floatArray.toFloatArray();
+                Assert.assertEquals(originFloatArray, floats);
+                double[] ndArrayDouble = doubleArray.toDoubleArray();
+                Assert.assertEquals(originDoubleArray, ndArrayDouble);
+                long[] ndArrayLong = longArray.toLongArray();
+                Assert.assertEquals(originLongArray, ndArrayLong);
+                boolean[] ndArrayBoolean = booleanArray.toBooleanArray();
+                Assert.assertEquals(originBooleanArray, ndArrayBoolean);
+                byte[] ndArrayByte = byteArray.toByteArray();
+                Assert.assertEquals(originByteArray, ndArrayByte);
+
+                int[] ndArrayInt2 = intArray2.toIntArray();
+                Assert.assertEquals(originIntegerArray, ndArrayInt2);
+
+                // Float -> Double
+                float[] floats2 = floatArray2.toFloatArray();
+                Assert.assertEquals(originFloatArray, floats2);
+                double[] ndArrayDouble2 = doubleArray2.toDoubleArray();
+                Assert.assertEquals(originDoubleArray, ndArrayDouble2);
+                long[] ndArrayLong2 = longArray2.toLongArray();
+                Assert.assertEquals(originLongArray, ndArrayLong2);
+                boolean[] ndArrayBoolean2 = booleanArray2.toBooleanArray();
+                Assert.assertEquals(originBooleanArray, ndArrayBoolean2);
+                byte[] ndArrayByte2 = byteArray2.toByteArray();
+                Assert.assertEquals(originByteArray, ndArrayByte2);
+            } catch (ClassCastException e) {
+                logger.error(e.getMessage());
+                throw e;
+            }
+            BaseMxResource base = BaseMxResource.getSystemMxResource();
+            Assert.assertEquals(base.getSubResource().size(), 0);
+        } catch (ClassCastException e) {
+            logger.error(e.getMessage());
+            throw e;
+        }
+    }
+
+    //    @Test

Review comment:
       fix 139 error in the C code and uncomment this line

##########
File path: ci/docker/runtime_functions.sh
##########
@@ -1404,6 +1429,21 @@ test_artifact_repository() {
     popd
 }
 
+integration_test() {
+    # install gradle
+    add-apt-repository ppa:cwchien/gradle
+    apt-get update -y
+    apt-get install gradle -y

Review comment:
       remove this line

##########
File path: java-package/tools/gradle/cpp-formatter.gradle
##########
@@ -0,0 +1,86 @@
+apply plugin: CppFormatterPlugin

Review comment:
       Not necessary to keep




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 commented on pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-909399129


   failed with :
   ```
   [2021-08-17T16:11:35.398Z] license_header.py: ERROR File java-package/gradlew.bat doesn't have a valid license
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] channel960608 commented on a change in pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
channel960608 commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r702294037



##########
File path: java-package/native/src/main/resources/META-INF/backport.txt
##########
@@ -0,0 +1,2 @@
+The file is based off Apache MXNet 1.7 branch (https://github.com/apache/incubator-mxnet/commit/7a84fe11dd7399d1c2bdd0fb679c46af69e48861)

Review comment:
       This file gets removed because it has never been used in this project.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 merged pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 merged pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] marcoabreu commented on a change in pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
marcoabreu commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r699499877



##########
File path: ci/docker/runtime_functions.sh
##########
@@ -1404,6 +1429,21 @@ test_artifact_repository() {
     popd
 }
 
+integration_test() {
+    # install gradle
+    add-apt-repository ppa:cwchien/gradle
+    apt-get update -y
+    apt-get install gradle -y

Review comment:
       Remove everything apt related here. That belongs into a Dockerfile.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] leezu commented on pull request #20461: [WIP] Java2.0 proto

Posted by GitBox <gi...@apache.org>.
leezu commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-883571260


   Ok, thank you. I've updated the java2.0 branch just now


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] channel960608 commented on a change in pull request #20461: [WIP] Java2.0 proto

Posted by GitBox <gi...@apache.org>.
channel960608 commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r674637100



##########
File path: java-package/integration/build.gradle
##########
@@ -0,0 +1,47 @@
+plugins {
+    id 'application'
+    id 'java'
+}
+
+group 'incubator-mxnet.java-package'
+version '0.0.1-SNAPSHOT'
+
+repositories {
+    mavenCentral()
+}
+
+application {
+    mainClassName = System.getProperty("main", "org.apache.mxnet.integration.IntegrationTest")
+}
+
+dependencies {
+    api "commons-cli:commons-cli:${commons_cli_version}"
+    api "org.apache.logging.log4j:log4j-slf4j-impl:${log4j_slf4j_version}"
+
+    api project(":mxnet-engine")
+    implementation 'org.testng:testng:7.1.0'
+//    testImplementation(":mxnet-engine")
+    testImplementation("org.testng:testng:${testng_version}") {
+        exclude group: "junit", module: "junit"
+    }
+    testImplementation "org.slf4j:slf4j-simple:${slf4j_version}"
+}
+
+run {
+    environment("TF_CPP_MIN_LOG_LEVEL", "1") // turn off TensorFlow print out

Review comment:
       > can you do
   > 
   > ```
   > git submodule update --init --recursive
   > ```
   > 
   > ?
   
   - Solved this problem by hard reset the version of these submodules, after some attempts 😄 .
   - Removed this TF used only environment variable.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] channel960608 commented on a change in pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
channel960608 commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r699505175



##########
File path: docker/dev/docker_run.sh
##########
@@ -0,0 +1,44 @@
+#

Review comment:
       Removed

##########
File path: ci/docker/runtime_functions.sh
##########
@@ -1404,6 +1429,21 @@ test_artifact_repository() {
     popd
 }
 
+integration_test() {
+    # install gradle
+    add-apt-repository ppa:cwchien/gradle
+    apt-get update -y
+    apt-get install gradle -y

Review comment:
       Removed all apt-get related codes




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] barry-jin commented on a change in pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
barry-jin commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r699500913



##########
File path: java-package/gradle/wrapper/gradle-wrapper.properties
##########
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME

Review comment:
       Please add license to this file. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-930409048


   Jenkins CI successfully triggered : [clang]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] channel960608 commented on pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
channel960608 commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-930408984


   @mxnet-bot run ci [clang]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 commented on pull request #20461: [WIP] Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-884325393


   can you do 
   
   ```
   git submodule update --init --recursive
   ```
   ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 commented on pull request #20461: [WIP] Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-886882142


   Would suggest to use
   
   ```
   git rebase -i
   ```
   to squash your commit into one for better rebasing with master branch.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 commented on a change in pull request #20461: [WIP] Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r674149549



##########
File path: java-package/integration/build.gradle
##########
@@ -0,0 +1,47 @@
+plugins {
+    id 'application'
+    id 'java'
+}
+
+group 'incubator-mxnet.java-package'
+version '0.0.1-SNAPSHOT'
+
+repositories {
+    mavenCentral()
+}
+
+application {
+    mainClassName = System.getProperty("main", "org.apache.mxnet.integration.IntegrationTest")
+}
+
+dependencies {
+    api "commons-cli:commons-cli:${commons_cli_version}"
+    api "org.apache.logging.log4j:log4j-slf4j-impl:${log4j_slf4j_version}"
+
+    api project(":mxnet-engine")
+    implementation 'org.testng:testng:7.1.0'
+//    testImplementation(":mxnet-engine")
+    testImplementation("org.testng:testng:${testng_version}") {
+        exclude group: "junit", module: "junit"
+    }
+    testImplementation "org.slf4j:slf4j-simple:${slf4j_version}"
+}
+
+run {
+    environment("TF_CPP_MIN_LOG_LEVEL", "1") // turn off TensorFlow print out

Review comment:
       For TF use only




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 commented on a change in pull request #20461: [WIP] Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r679314617



##########
File path: java-package/mxnet-engine/src/main/java/org/apache/mxnet/training/initializer/XavierInitializer.java
##########
@@ -0,0 +1,140 @@
+/*

Review comment:
       We don't need initializer at this moment

##########
File path: java-package/tools/scripts/add_online_runner.py
##########
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one

Review comment:
       We don't need this

##########
File path: java-package/mxnet-engine/src/main/java/org/apache/mxnet/training/initializer/Initializer.java
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.training.initializer;
+
+import org.apache.mxnet.engine.Device;
+import org.apache.mxnet.engine.MxResource;
+import org.apache.mxnet.ndarray.NDArray;
+import org.apache.mxnet.ndarray.types.DataType;
+import org.apache.mxnet.ndarray.types.Shape;
+import org.apache.mxnet.nn.SymbolBlock;
+
+/**
+ * An interface representing an initialization method.
+ *
+ * <p>Used to initialize the {@link NDArray} parameters stored within a {@link SymbolBlock}.
+ *
+ * @see <a
+ *     href="https://d2l.djl.ai/chapter_multilayer-perceptrons/numerical-stability-and-init.html">The
+ *     D2L chapter on numerical stability and initialization</a>
+ */
+public interface Initializer {

Review comment:
       We don't need initializer at this moment

##########
File path: java-package/mxnet-engine/src/main/java/org/apache/mxnet/training/ParameterServer.java
##########
@@ -0,0 +1,58 @@
+/*
+ * 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.training;
+
+import org.apache.mxnet.ndarray.NDArray;
+
+import java.util.Arrays;
+
+/** An interface for a key-value store to store parameters, and their corresponding gradients. */
+public interface ParameterServer extends AutoCloseable {

Review comment:
       We don't require parameter server or parameter store for inference purpose

##########
File path: java-package/tools/scripts/broken_link_checker.sh
##########
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+#
+# 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.
+#
+
+# installation
+sudo apt-get update
+curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
+sudo apt-get install -y nodejs
+sudo apt-get install npm
+sudo npm install -g markdown-link-check
+sudo npm install broken-link-checker -g
+
+
+# check brokenlinks in md files
+for i in $(find ../../ -name '*.md');

Review comment:
       We don't need this




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 commented on a change in pull request #20461: [WIP] Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r676790330



##########
File path: java-package/build.gradle
##########
@@ -0,0 +1,113 @@
+plugins {
+    id "com.github.spotbugs" version "4.2.0" apply true
+}
+
+defaultTasks 'build'
+
+allprojects {
+    group 'incubator-mxnet.java-package'

Review comment:
       org.apache.mxnet as the group name?

##########
File path: java-package/integration/src/main/java/org/apache/mxnet/integration/IntegrationTest.java
##########
@@ -0,0 +1,407 @@
+package org.apache.mxnet.integration;

Review comment:
       This should come after the header

##########
File path: java-package/mxnet-engine/src/main/include/mxnet/c_api.h
##########
@@ -0,0 +1,3149 @@
+/*

Review comment:
       Since now you are under apache-mxnet project, you can take the c_api.h directly from the repo instead of preserving a copy.

##########
File path: java-package/mxnet-engine/src/main/include/mxnet/c_api_1_8.h
##########
@@ -0,0 +1,3422 @@
+/*

Review comment:
       why keeping this?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 commented on a change in pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r716900076



##########
File path: java-package/mxnet-engine/src/main/java/org/apache/mxnet/ndarray/types/DataType.java
##########
@@ -0,0 +1,148 @@
+/*
+ * 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.ndarray.types;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+import java.nio.DoubleBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.nio.LongBuffer;
+import org.apache.mxnet.ndarray.NDArray;
+
+/** An enum representing the underlying {@link NDArray}'s data type. */
+public enum DataType {
+    FLOAT32(Format.FLOATING, 4),
+    FLOAT64(Format.FLOATING, 8),
+    FLOAT16(Format.FLOATING, 2),
+    UINT8(Format.UINT, 1),
+    INT32(Format.INT, 4),
+    INT8(Format.INT, 1),
+    INT64(Format.INT, 8),
+    BOOLEAN(Format.BOOLEAN, 1),
+    UNKNOWN(Format.UNKNOWN, 0),
+    STRING(Format.STRING, -1);

Review comment:
       There is no String type in MXNet

##########
File path: src/initialize.cc
##########
@@ -375,9 +375,12 @@ std::shared_ptr<void(int)> HANDLER_NAME(                             \
   }),                                                                \
   [](auto f) { signal(SIGNAL, f); });
 
+// TODO(cspchen): avoid jvm exit with code 139. By now, we just skip it

Review comment:
       Make a link to this PR so others can see




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-930409048


   Jenkins CI successfully triggered : [clang]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] leezu commented on pull request #20461: [WIP] Jave2.0 proto

Posted by GitBox <gi...@apache.org>.
leezu commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-883418294


   java2.0 branch is currently 21 commits behind master. This PR would be easier to review if you can update the java2.0 branch to match master first, and only include new / original commits in this PR. Thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 commented on pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-909399129






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 commented on a change in pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r699481157



##########
File path: java-package/integration/src/main/java/org/apache/mxnet/integration/tests/engine/ModelTest.java
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.integration.tests.engine;
+
+import java.io.IOException;
+import org.apache.mxnet.engine.BaseMxResource;
+import org.apache.mxnet.engine.Model;
+import org.apache.mxnet.engine.MxResource;
+import org.apache.mxnet.engine.Predictor;
+import org.apache.mxnet.integration.tests.jna.JnaUtilTest;
+import org.apache.mxnet.integration.util.Assertions;
+import org.apache.mxnet.ndarray.NDArray;
+import org.apache.mxnet.ndarray.NDList;
+import org.apache.mxnet.ndarray.types.Shape;
+import org.apache.mxnet.repository.Item;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.Test;
+
+public class ModelTest {
+    private static final Logger logger = LoggerFactory.getLogger(JnaUtilTest.class);
+
+    @Test
+    public void modelLoadAndPredictTest() {
+        try (MxResource base = BaseMxResource.getSystemMxResource()) {
+            Model model = Model.loadModel(Item.MLP);
+            //            Model model = Model.loadModel("test",

Review comment:
       remove comments

##########
File path: docker/dev/docker_run.sh
##########
@@ -0,0 +1,44 @@
+#

Review comment:
       put to Java-package folder

##########
File path: java-package/native/src/main/resources/META-INF/backport.txt
##########
@@ -0,0 +1,2 @@
+The file is based off Apache MXNet 1.7 branch (https://github.com/apache/incubator-mxnet/commit/7a84fe11dd7399d1c2bdd0fb679c46af69e48861)

Review comment:
       check what does this line do

##########
File path: src/initialize.cc
##########
@@ -373,7 +373,18 @@ std::shared_ptr<void(int)> HANDLER_NAME(                             \
       }                                                              \
     }                                                                \
   }),                                                                \
-  [](auto f) { signal(SIGNAL, f); });
+  [](auto f) {                                                       \

Review comment:
       add a comment above and tell why you make this change

##########
File path: java-package/mxnet-engine/src/main/java/org/apache/mxnet/engine/GradReq.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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.engine;
+
+/** An enum that indicates whether gradient is required. */
+public enum GradReq {

Review comment:
       Check the usage of this class. Not sure this is being used

##########
File path: java-package/mxnet-engine/src/main/java/org/apache/mxnet/ndarray/types/SparseNDArray.java
##########
@@ -0,0 +1,33 @@
+/*
+ * 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.ndarray.types;
+
+import com.sun.jna.Pointer;
+import org.apache.mxnet.ndarray.NDArray;
+
+/**
+ * An interface representing a Sparse NDArray.
+ *
+ * @see SparseFormat
+ * @see <a href="https://software.intel.com/en-us/node/471374">Sparse Matrix Storage Formats</a>
+ */
+public class SparseNDArray extends NDArray {

Review comment:
       Consider remove

##########
File path: java-package/mxnet-engine/src/main/java/org/apache/mxnet/ndarray/types/SparseFormat.java
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.ndarray.types;
+
+/**
+ * An enum representing Sparse matrix storage formats.
+ *
+ * <ul>
+ *   <li>DENSE: Stride format
+ *   <li>ROW_SPARSE: Row Sparse
+ *   <li>CSR: Compressed Sparse Row
+ * </ul>
+ *
+ * @see <a href="https://software.intel.com/en-us/node/471374">Sparse Matrix Storage Formats</a>
+ */
+public enum SparseFormat {
+    // the dense format is accelerated by MKLDNN by default
+    DENSE("default", 0),
+    ROW_SPARSE("row_sparse", 1),
+    CSR("csr", 2),
+    COO("coo", 3);

Review comment:
       We don't use COO

##########
File path: java-package/mxnet-engine/src/main/java/org/apache/mxnet/nn/Parameter.java
##########
@@ -0,0 +1,327 @@
+/*
+ * 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.nn;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.util.Objects;
+import java.util.UUID;
+import org.apache.mxnet.engine.Device;
+import org.apache.mxnet.engine.MxResource;
+import org.apache.mxnet.exception.MalformedModelException;
+import org.apache.mxnet.ndarray.NDArray;
+import org.apache.mxnet.ndarray.NDSerializer;
+import org.apache.mxnet.ndarray.types.DataType;
+import org.apache.mxnet.ndarray.types.Shape;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * {@code Parameter} is a container class that holds a learnable parameter of a model.
+ *
+ * <p>Every {@code Parameter} is associated with a {@link SymbolBlock}. The output of the block's
+ * forward function depends on the values in the {@code Parameter}. During training, the values in
+ * the {@code Parameter} are updated to reflect the training data. This process forms the crux of
+ * learning.
+ *
+ * @see <a href="https://d2l.djl.ai/chapter_deep-learning-computation/parameters.html">The D2L
+ *     chapter on parameter management</a>
+ */
+public class Parameter extends MxResource {
+    private static final Logger logger = LoggerFactory.getLogger(Parameter.class);
+
+    private static final byte VERSION = 1;
+
+    private String id;
+    private String name;
+    private Shape shape;
+    private Type type;
+    private NDArray array;
+    private boolean requiresGrad;
+
+    Parameter(Builder builder) {
+        this.id = UUID.randomUUID().toString();
+        this.name = builder.name;
+        this.shape = builder.shape;
+        this.type = builder.type;
+        this.array = builder.array;
+        this.requiresGrad = builder.requiresGrad;
+    }
+
+    /**
+     * Gets the ID of this {@code Parameter}.
+     *
+     * @return the ID of this {@code Parameter}
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Gets the name of this {@code Parameter}.
+     *
+     * @return the name of this {@code Parameter}
+     */
+    public String getName() {
+        return name == null ? "" : name;
+    }
+
+    /**
+     * Gets the type of this {@code Parameter}.
+     *
+     * @return the type of this {@code Parameter}
+     */
+    public Type getType() {
+        return type;
+    }
+
+    /**
+     * Sets the values of this {@code Parameter}.
+     *
+     * @param array the {@link NDArray} that contains values of this {@code Parameter}
+     */
+    public void setArray(NDArray array) {
+        if (shape != null) {
+            throw new IllegalStateException("array has been set! Use either setArray or setShape");
+        }
+        this.array = array;
+        shape = array.getShape();
+        array.setName(name);
+    }
+
+    /**
+     * Sets the shape of this {@code Parameter}.
+     *
+     * @param shape the shape of this {@code Parameter}
+     */
+    public void setShape(Shape shape) {
+        if (array != null) {
+            throw new IllegalStateException("array has been set! Use either setArray or setShape");
+        }
+        this.shape = shape;
+    }
+
+    /**
+     * Gets the values of this {@code Parameter} as an {@link NDArray}.
+     *
+     * @return an {@link NDArray} that contains values of this {@code Parameter}
+     */
+    public NDArray getArray() {
+        if (!isInitialized()) {
+            throw new IllegalStateException("The array has not been initialized");
+        }
+        return array;
+    }
+
+    /**
+     * Returns whether this parameter needs gradients to be computed.
+     *
+     * @return whether this parameter needs gradients to be computed
+     */
+    public boolean requiresGradient() {
+        return requiresGrad;

Review comment:
       remove this

##########
File path: java-package/integration/src/main/java/org/apache/mxnet/integration/tests/jna/JnaUtilTest.java
##########
@@ -0,0 +1,176 @@
+/*
+ * 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.integration.tests.jna;
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import org.apache.mxnet.engine.BaseMxResource;
+import org.apache.mxnet.engine.Device;
+import org.apache.mxnet.engine.MxResource;
+import org.apache.mxnet.engine.Symbol;
+import org.apache.mxnet.jna.JnaUtils;
+import org.apache.mxnet.ndarray.NDArray;
+import org.apache.mxnet.ndarray.NDList;
+import org.apache.mxnet.ndarray.types.Shape;
+import org.apache.mxnet.nn.Parameter;
+import org.apache.mxnet.nn.SymbolBlock;
+import org.apache.mxnet.repository.Item;
+import org.apache.mxnet.repository.Repository;
+import org.apache.mxnet.util.PairList;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class JnaUtilTest {
+
+    private static final Logger logger = LoggerFactory.getLogger(JnaUtilTest.class);
+
+    @Test
+    public void doForwardTest() throws IOException {
+        try (MxResource base = BaseMxResource.getSystemMxResource()) {
+            Path modelPath = Repository.initRepository(Item.MLP);
+            Path symbolPath = modelPath.resolve("mlp-symbol.json");
+            Path paramsPath = modelPath.resolve("mlp-0000.params");
+            Symbol symbol = Symbol.loadSymbol(base, symbolPath);
+            SymbolBlock block = new SymbolBlock(base, symbol);
+            Device device = Device.defaultIfNull();
+            NDList mxNDArray = JnaUtils.loadNdArray(base, paramsPath, Device.defaultIfNull(null));
+
+            // load parameters
+            List<Parameter> parameters = block.getAllParameters();
+            Map<String, Parameter> map = new ConcurrentHashMap<>();
+            parameters.forEach(p -> map.put(p.getName(), p));
+
+            for (NDArray nd : mxNDArray) {
+                String key = nd.getName();
+                if (key == null) {
+                    throw new IllegalArgumentException(
+                            "Array names must be present in parameter file");
+                }
+
+                String paramName = key.split(":", 2)[1];
+                Parameter parameter = map.remove(paramName);
+                parameter.setArray(nd);
+            }
+            block.setInputNames(new ArrayList<>(map.keySet()));
+
+            NDArray arr = NDArray.create(base, new Shape(1, 28, 28), device).ones();
+            block.forward(new NDList(arr), new PairList<>(), device);
+            logger.info(
+                    "Number of MxResource managed by baseMxResource: {}",
+                    BaseMxResource.getSystemMxResource().getSubResource().size());
+        } catch (IOException e) {
+            logger.error(e.getMessage(), e);
+            throw e;
+        }
+        Assert.assertEquals(BaseMxResource.getSystemMxResource().getSubResource().size(), 0);
+    }
+
+    @Test
+    public void createNdArray() {
+        try {
+            try (BaseMxResource base = BaseMxResource.getSystemMxResource()) {
+                int[] originIntegerArray = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
+                float[] originFloatArray = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
+                double[] originDoubleArray = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
+                long[] originLongArray = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
+                boolean[] originBooleanArray = {
+                    true, false, false, true, true, true, true, false, false, true, true, true
+                };
+                byte[] originByteArray = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
+                NDArray intArray = NDArray.create(base, originIntegerArray, new Shape(3, 4));
+                NDArray floatArray = NDArray.create(base, originFloatArray, new Shape(3, 4));
+                NDArray doubleArray = NDArray.create(base, originDoubleArray, new Shape(3, 4));
+                NDArray longArray = NDArray.create(base, originLongArray, new Shape(3, 4));
+                NDArray booleanArray = NDArray.create(base, originBooleanArray, new Shape(3, 4));
+                NDArray byteArray = NDArray.create(base, originByteArray, new Shape(3, 4));
+                NDArray intArray2 = NDArray.create(base, originIntegerArray);
+                NDArray floatArray2 = NDArray.create(base, originFloatArray);
+                NDArray doubleArray2 = NDArray.create(base, originDoubleArray);
+                NDArray longArray2 = NDArray.create(base, originLongArray);
+                NDArray booleanArray2 = NDArray.create(base, originBooleanArray);
+                NDArray byteArray2 = NDArray.create(base, originByteArray);
+
+                int[] ndArrayInt = intArray.toIntArray();
+                Assert.assertEquals(originIntegerArray, ndArrayInt);
+                // Float -> Double
+                float[] floats = floatArray.toFloatArray();
+                Assert.assertEquals(originFloatArray, floats);
+                double[] ndArrayDouble = doubleArray.toDoubleArray();
+                Assert.assertEquals(originDoubleArray, ndArrayDouble);
+                long[] ndArrayLong = longArray.toLongArray();
+                Assert.assertEquals(originLongArray, ndArrayLong);
+                boolean[] ndArrayBoolean = booleanArray.toBooleanArray();
+                Assert.assertEquals(originBooleanArray, ndArrayBoolean);
+                byte[] ndArrayByte = byteArray.toByteArray();
+                Assert.assertEquals(originByteArray, ndArrayByte);
+
+                int[] ndArrayInt2 = intArray2.toIntArray();
+                Assert.assertEquals(originIntegerArray, ndArrayInt2);
+
+                // Float -> Double
+                float[] floats2 = floatArray2.toFloatArray();
+                Assert.assertEquals(originFloatArray, floats2);
+                double[] ndArrayDouble2 = doubleArray2.toDoubleArray();
+                Assert.assertEquals(originDoubleArray, ndArrayDouble2);
+                long[] ndArrayLong2 = longArray2.toLongArray();
+                Assert.assertEquals(originLongArray, ndArrayLong2);
+                boolean[] ndArrayBoolean2 = booleanArray2.toBooleanArray();
+                Assert.assertEquals(originBooleanArray, ndArrayBoolean2);
+                byte[] ndArrayByte2 = byteArray2.toByteArray();
+                Assert.assertEquals(originByteArray, ndArrayByte2);
+            } catch (ClassCastException e) {
+                logger.error(e.getMessage());
+                throw e;
+            }
+            BaseMxResource base = BaseMxResource.getSystemMxResource();
+            Assert.assertEquals(base.getSubResource().size(), 0);
+        } catch (ClassCastException e) {
+            logger.error(e.getMessage());
+            throw e;
+        }
+    }
+
+    //    @Test

Review comment:
       fix 139 error in the C code and uncomment this line

##########
File path: ci/docker/runtime_functions.sh
##########
@@ -1404,6 +1429,21 @@ test_artifact_repository() {
     popd
 }
 
+integration_test() {
+    # install gradle
+    add-apt-repository ppa:cwchien/gradle
+    apt-get update -y
+    apt-get install gradle -y

Review comment:
       remove this line

##########
File path: java-package/tools/gradle/cpp-formatter.gradle
##########
@@ -0,0 +1,86 @@
+apply plugin: CppFormatterPlugin

Review comment:
       Not necessary to keep




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] channel960608 commented on a change in pull request #20461: [WIP] Java2.0 proto

Posted by GitBox <gi...@apache.org>.
channel960608 commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r677146849



##########
File path: java-package/mxnet-engine/src/main/include/mxnet/c_api_1_8.h
##########
@@ -0,0 +1,3422 @@
+/*

Review comment:
       All fixed.
   - Remove unnecessary prefix _Mx_ for a few Classes;
   - Update copyright for this module;
   - Take the _c_api.h_ directly from the upper directory.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] marcoabreu commented on a change in pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
marcoabreu commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r699499877



##########
File path: ci/docker/runtime_functions.sh
##########
@@ -1404,6 +1429,21 @@ test_artifact_repository() {
     popd
 }
 
+integration_test() {
+    # install gradle
+    add-apt-repository ppa:cwchien/gradle
+    apt-get update -y
+    apt-get install gradle -y

Review comment:
       Remove everything apt related here. That belongs into a Dockerfile.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 commented on pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-927161005


   Is now a good time to review?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] channel960608 commented on a change in pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
channel960608 commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r699505175



##########
File path: docker/dev/docker_run.sh
##########
@@ -0,0 +1,44 @@
+#

Review comment:
       Removed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 commented on a change in pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r716902077



##########
File path: src/initialize.cc
##########
@@ -375,9 +375,12 @@ std::shared_ptr<void(int)> HANDLER_NAME(                             \
   }),                                                                \
   [](auto f) { signal(SIGNAL, f); });
 
+// TODO(cspchen): avoid jvm exit with code 139. By now, we just skip it

Review comment:
       Make a link to this PR so others can see




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 commented on pull request #20461: [WIP] Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-886881392


   Can you add a new GitHub action to test your project?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] channel960608 commented on a change in pull request #20461: [WIP] Java2.0 proto

Posted by GitBox <gi...@apache.org>.
channel960608 commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r680492429



##########
File path: java-package/mxnet-engine/src/main/java/org/apache/mxnet/training/ParameterServer.java
##########
@@ -0,0 +1,58 @@
+/*
+ * 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.training;
+
+import org.apache.mxnet.ndarray.NDArray;
+
+import java.util.Arrays;
+
+/** An interface for a key-value store to store parameters, and their corresponding gradients. */
+public interface ParameterServer extends AutoCloseable {

Review comment:
       These classes not required mentioned above are removed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] channel960608 commented on pull request #20461: [WIP] Java2.0 proto

Posted by GitBox <gi...@apache.org>.
channel960608 commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-883440887


   > java2.0 branch is currently 21 commits behind master. This PR would be easier to review if you can update the java2.0 branch to match master first, and only include new / original commits in this PR. Thank you!
   
   That's right. I will contact @lanking520  to update java2.0 branch. Thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] barry-jin commented on a change in pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
barry-jin commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r699500913



##########
File path: java-package/gradle/wrapper/gradle-wrapper.properties
##########
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME

Review comment:
       Please add license to this file. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] channel960608 commented on a change in pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
channel960608 commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r699560586



##########
File path: ci/docker/runtime_functions.sh
##########
@@ -1404,6 +1429,21 @@ test_artifact_repository() {
     popd
 }
 
+integration_test() {
+    # install gradle
+    add-apt-repository ppa:cwchien/gradle
+    apt-get update -y
+    apt-get install gradle -y

Review comment:
       Removed all apt-get related codes




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] channel960608 commented on pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
channel960608 commented on pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#issuecomment-930408984


   @mxnet-bot run ci [clang]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] lanking520 commented on a change in pull request #20461: Java2.0 proto

Posted by GitBox <gi...@apache.org>.
lanking520 commented on a change in pull request #20461:
URL: https://github.com/apache/incubator-mxnet/pull/20461#discussion_r716900076



##########
File path: java-package/mxnet-engine/src/main/java/org/apache/mxnet/ndarray/types/DataType.java
##########
@@ -0,0 +1,148 @@
+/*
+ * 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.ndarray.types;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+import java.nio.DoubleBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.nio.LongBuffer;
+import org.apache.mxnet.ndarray.NDArray;
+
+/** An enum representing the underlying {@link NDArray}'s data type. */
+public enum DataType {
+    FLOAT32(Format.FLOATING, 4),
+    FLOAT64(Format.FLOATING, 8),
+    FLOAT16(Format.FLOATING, 2),
+    UINT8(Format.UINT, 1),
+    INT32(Format.INT, 4),
+    INT8(Format.INT, 1),
+    INT64(Format.INT, 8),
+    BOOLEAN(Format.BOOLEAN, 1),
+    UNKNOWN(Format.UNKNOWN, 0),
+    STRING(Format.STRING, -1);

Review comment:
       There is no String type in MXNet




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org