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/06/29 11:57:30 UTC

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

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

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/OperatorSuite.scala b/scala-package/core/src/test/scala/org/apache/mxnet/OperatorSuite.scala
index 55319338b29..dd5f96f980a 100644
--- a/scala-package/core/src/test/scala/org/apache/mxnet/OperatorSuite.scala
+++ b/scala-package/core/src/test/scala/org/apache/mxnet/OperatorSuite.scala
@@ -18,12 +18,12 @@
 package org.apache.mxnet
 
 import org.apache.mxnet.CheckUtils._
-
 import org.scalatest.prop.GeneratorDrivenPropertyChecks
-import org.scalatest.{Matchers, BeforeAndAfterAll, FunSuite}
+import org.scalatest.{BeforeAndAfterAll, FunSuite, Matchers}
 import org.scalacheck.Gen
 
 import scala.collection.mutable
+import scala.collection.mutable.ArrayBuffer
 
 class OperatorSuite extends FunSuite with BeforeAndAfterAll
   with Matchers with GeneratorDrivenPropertyChecks {
@@ -233,8 +233,9 @@ class OperatorSuite extends FunSuite with BeforeAndAfterAll
       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 x = Symbol.arange(start = start, stop = Some(stop), step = step, repeat = repeat)
       var exe = x.simpleBind(ctx = Context.cpu(), gradReq = "write", shapeDict = Map())
       exe.forward(isTrain = false)


 

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