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 2018/07/16 20:48:48 UTC

[GitHub] nswamy closed pull request #11766: [MXNET-564] Fix the Flaky test on arange for NDArray

nswamy closed pull request #11766: [MXNET-564] Fix the Flaky test on arange for NDArray
URL: https://github.com/apache/incubator-mxnet/pull/11766
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/scala-package/core/src/test/scala/org/apache/mxnet/NDArraySuite.scala b/scala-package/core/src/test/scala/org/apache/mxnet/NDArraySuite.scala
index 537a9702f99..5d88bb39e50 100644
--- a/scala-package/core/src/test/scala/org/apache/mxnet/NDArraySuite.scala
+++ b/scala-package/core/src/test/scala/org/apache/mxnet/NDArraySuite.scala
@@ -166,8 +166,9 @@ class NDArraySuite extends FunSuite with BeforeAndAfterAll with Matchers {
       val start = scala.util.Random.nextFloat() * 5
       val stop = start + scala.util.Random.nextFloat() * 100
       val step = scala.util.Random.nextFloat() * 4
-      val repeat = (scala.util.Random.nextFloat() * 5).toInt + 1
-      val result = (start until stop by step).flatMap(x => Array.fill[Float](repeat)(x))
+      val repeat = 1
+      val result = (start.toDouble until stop.toDouble by step.toDouble)
+              .flatMap(x => Array.fill[Float](repeat)(x.toFloat))
       val range = NDArray.arange(start = start, stop = Some(stop), step = step,
         repeat = repeat, ctx = Context.cpu(), dType = DType.Float32)
       assert(CheckUtils.reldiff(result.toArray, range.toArray) <= 1e-4f)


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services