> ## What's missing
>
> javacpp-presets-mxnet doesn't expose APIs form nnvm/c_api.h (some of current
> python/gluon API depends on APIs in nnvm/c_api.h)
I've added that the other day, thanks to @frankfliu for pointing this out:
https://github.com/bytedeco/javacpp-presets/commit/976e6f7d307b3f3855f39413c494d8f482c9adf6
> See javadoc: http://bytedeco.org/javacpp-presets/mxnet/apidocs/
>
> 1. Java class name is “mxnet”, which is not following java naming conventions
That's not hardcoded. We can use whatever name we want for that class.
> 2. Each pointer has a corresponding java class, which is arguable. It's
> necessary to expose them as strong type class if they meant to be used
> directly by end developer. But they really should only be internal
> implementation of the API. It's overkill to expose them as a Type instead of
> just a pointer.
We can map everything to `Pointer`, that's not a problem either.
> 3. All the classes (except mxnet.java) are hand written.
No, they are not. Everything in the `src/gen` directory here is generated at
build time:
https://github.com/bytedeco/javacpp-presets/tree/master/mxnet/src/gen/java/org/bytedeco/mxnet
> 4. API mapping are hand coded as well.
If you're talking about this file, yes, that's the only thing that is written
manually:
https://github.com/bytedeco/javacpp-presets/blob/master/mxnet/src/main/java/org/bytedeco/mxnet/presets/mxnet.java
(The formatting is a bit crappy, I haven't touched it in a while, but we can
make it look prettier like this:
https://github.com/bytedeco/javacpp-presets/blob/master/onnxruntime/src/main/java/org/bytedeco/onnxruntime/presets/onnxruntime.java
)
> ## Performance
>
> JavaCPP native library load takes a long time, it takes average _2.6 seconds_
> to initialize libmxnet.so with javacpp.
>
> Loader.load(org.bytedeco.mxnet.global.mxnet.class);
Something's wrong, that takes less than 500 ms on my laptop, and that includes
loading OpenBLAS, OpenCV, and a lookup for CUDA and MKL, which can obviously be
optimized... In any case, we can debug that later to see what is going wrong on
your end.
> ## Issues
>
> The open source code on github doesn't match the binary release on maven
> central:
>
> * the maven group and the java package name are different.
Both the group ID and the package names are `org.bytedeco`, but in any case, if
that gets maintained somewhere here, I imagine it would be changed to something
like `org.apache.mxnet.xyz.internal.etc`
> * c predict API is not included in maven version
Yes it is:
http://bytedeco.org/javacpp-presets/mxnet/apidocs/org/bytedeco/mxnet/global/mxnet.html
> * Example code doesn't work with maven artifacts, it can only build with
> snapshot version locally.
https://github.com/bytedeco/javacpp-presets/tree/master/mxnet/samples works
fine for me on Linux:
```
$ mvn -U clean compile exec:java -Djavacpp.platform.custom
-Djavacpp.platform.host -Dexec.args=apple.jpg
...
Downloading from sonatype-nexus-snapshots:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/mxnet-platform/1.7.0.rc1-1.5.4-SNAPSHOT/maven-metadata.xml
Downloaded from sonatype-nexus-snapshots:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/mxnet-platform/1.7.0.rc1-1.5.4-SNAPSHOT/maven-metadata.xml
(1.3 kB at 2.5 kB/s)
Downloading from sonatype-nexus-snapshots:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/mxnet-platform/1.7.0.rc1-1.5.4-SNAPSHOT/mxnet-platform-1.7.0.rc1-1.5.4-20200725.115300-20.pom
Downloaded from sonatype-nexus-snapshots:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/mxnet-platform/1.7.0.rc1-1.5.4-SNAPSHOT/mxnet-platform-1.7.0.rc1-1.5.4-20200725.115300-20.pom
(4.7 kB at 9.3 kB/s)
Downloading from sonatype-nexus-snapshots:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacpp-presets/1.5.4-SNAPSHOT/maven-metadata.xml
Downloaded from sonatype-nexus-snapshots:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacpp-presets/1.5.4-SNAPSHOT/maven-metadata.xml
(610 B at 1.5 kB/s)
Downloading from sonatype-nexus-snapshots:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacpp-presets/1.5.4-SNAPSHOT/javacpp-presets-1.5.4-20200725.155410-6590.pom
Downloaded from sonatype-nexus-snapshots:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacpp-presets/1.5.4-SNAPSHOT/javacpp-presets-1.5.4-20200725.155410-6590.pom
(84 kB at 91 kB/s)
Downloading from sonatype-nexus-snapshots:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/opencv-platform/4.4.0-1.5.4-SNAPSHOT/maven-metadata.xml
Downloaded from sonatype-nexus-snapshots:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/opencv-platform/4.4.0-1.5.4-SNAPSHOT/maven-metadata.xml
(1.2 kB at 2.6 kB/s)
Downloading from sonatype-nexus-snapshots:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/opencv-platform/