How is random_normal supposed to be used in scala


I’m trying to use random_normal in the Symbol API. In scala.

How is it supposed to be used ?
The docs mentions that loc and scale could be Symbols and have a shape (that’s what I’m looking for). Although, when I try to use the symbol:

val mean:Symbol...
val std:Symbol...
Symbol.random_normal(i.output)(mean, std)()

MXNet complains that arguments are incorrect.

org.apache.mxnet.MXNetError: [23:24:15] src/core/ Check failed: args.size() <= n_req (2 vs. 0) Incorrect number of arguments, requires 0, provided 2

Sounds like a bug to me. Or do I miss something ?


I already opened a ticket


It looks like you’ve already found a information for this over at Github, but just going to show an example usage on this thread for reference, based on @lanking520’s answer:

val nd = NDArray.random_normal(Map("loc" -> 0, "scale" -> 1, "shape" -> Shape(2, 2)))()

Currently Scala API doesn’t have a Symbolic random module, as found in Python (e.g. mxnet.symbol.random.normal).