mdespriee commented on issue #12140: Impossible to provide arguments to 
random_normal in scala ?
URL: 
https://github.com/apache/incubator-mxnet/issues/12140#issuecomment-412439645
 
 
   Actually, I tried that as well, and can't make it work either. 
   ```scala
   object NormalTest extends App {
     val mean = Symbol.Variable("mean")
     val std = Symbol.Variable("std")
     val s = Symbol.random_normal("gaussian")()(Map("loc"->mean, "scale"->std, 
"shape" -> (2,2)))
   
     val exec = s.bind(Context.defaultCtx, Map(
       "mean" -> NDArray.array(Array(0f, 10f), Shape(2)),
       "std" -> NDArray.array(Array(1f, 2f), Shape(2))
     ))
   
     exec.forward()
     println(s"Result= ${exec.outputs.head.toArray.mkString(",")} ")
   }
   ```
   
   ```
   # A fatal error has been detected by the Java Runtime Environment:
   #
   #  SIGSEGV (0xb) at pc=0x00007f0ec1a742eb, pid=4360, tid=0x00007f0efab2f700
   #
   # JRE version: OpenJDK Runtime Environment (8.0_151-b12) (build 
1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
   # Java VM: OpenJDK 64-Bit Server VM (25.151-b12 mixed mode linux-amd64 
compressed oops)
   # Problematic frame:
   # C  [mxnet-scala+0x6a32eb]  mxnet::NDArray::NDArray(mxnet::NDArray 
const&)+0xb
   ```
   and:
   ```
   Stack: [0x00007f0efaa2f000,0x00007f0efab30000],  sp=0x00007f0efab2d160,  
free space=1016k
   Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native 
code)
   C  [mxnet-scala+0x6a32eb]  mxnet::NDArray::NDArray(mxnet::NDArray const&)+0xb
   
   Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
   j  
org.apache.mxnet.LibInfo.mxExecutorBindEX(JIII[Ljava/lang/String;[I[II[J[J[I[JJLorg/apache/mxnet/Base$RefLong;)I+0
   j  
org.apache.mxnet.Symbol.bindHelper(Lorg/apache/mxnet/Context;Lscala/collection/Seq;Lscala/collection/Iterable;Lscala/collection/Iterable;Lscala/collection/Iterable;Lscala/collection/Iterable;Lscala/collection/immutable/Map;Lorg/apache/mxnet/Executor;)Lorg/apache/mxnet/Executor;+767
   j  
org.apache.mxnet.Symbol.bind(Lorg/apache/mxnet/Context;Lscala/collection/immutable/Map;)Lorg/apache/mxnet/Executor;+38
   j  NormalTest$.delayedEndpoint$NormalTest$1()V+365
   j  NormalTest$delayedInit$body.apply()Ljava/lang/Object;+4
   j  scala.Function0$class.apply$mcV$sp(Lscala/Function0;)V+1
   j  scala.runtime.AbstractFunction0.apply$mcV$sp()V+1
   j  scala.App$$anonfun$main$1.apply(Lscala/Function0;)V+1
   j  scala.App$$anonfun$main$1.apply(Ljava/lang/Object;)Ljava/lang/Object;+5
   J 13378 C2 scala.collection.immutable.List.foreach(Lscala/Function1;)V (32 
bytes) @ 0x00007f0f442aef24 [0x00007f0f442aee80+0xa4]
   J 15261 C1 
scala.collection.generic.TraversableForwarder$class.foreach(Lscala/collection/generic/TraversableForwarder;Lscala/Function1;)V
 (13 bytes) @ 0x00007f0f45cb6bfc [0x00007f0f45cb6b80+0x7c]
   j  scala.App$class.main(Lscala/App;[Ljava/lang/String;)V+21
   j  NormalTest$.main([Ljava/lang/String;)V+2
   ```
   

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