zachgk commented on a change in pull request #12690: [MXNET-1000] get Ndarray 
real value and form it from a NDArray
URL: https://github.com/apache/incubator-mxnet/pull/12690#discussion_r248081895
 
 

 ##########
 File path: 
scala-package/core/src/test/scala/org/apache/mxnet/NDArraySuite.scala
 ##########
 @@ -85,6 +89,31 @@ class NDArraySuite extends FunSuite with BeforeAndAfterAll 
with Matchers {
     assert(ndarray.toArray === Array(1f, 2f, 3f, 4f))
   }
 
+  test("create NDArray based on Java Matrix") {
+    val arrBuf = ArrayBuffer[Array[Float]]()
+    for (i <- 0 until 100) arrBuf += Array(1.0f, 1.0f, 1.0f, 1.0f)
+    val arr = Array(
+      Array(
+        arrBuf.toArray
+      ),
+      Array(
+        arrBuf.toArray
+        )
+    )
+    var nd = NDArray.toNDArray(arr)
+    require(nd.shape == Shape(2, 1, 100, 4))
+    val arr2 = Array(1.0f, 1.0f, 1.0f, 1.0f)
+    nd = NDArray.toNDArray(arr2)
+    require(nd.shape == Shape(4))
+  }
+
+  test("test Visualize") {
+    var nd = NDArray.ones(Shape(1, 2, 1000, 1))
+    logger.info(s"Test print large ndarray:\n$nd")
 
 Review comment:
   Can we make this test more automatic? Maybe test whether it contains the 
full output or not

----------------------------------------------------------------
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