lanking520 commented on a change in pull request #12489: [WIP][MXNET-918] 
Symbol Random api
URL: https://github.com/apache/incubator-mxnet/pull/12489#discussion_r217877281
 
 

 ##########
 File path: 
scala-package/macros/src/main/scala/org/apache/mxnet/NDArrayMacro.scala
 ##########
 @@ -79,6 +86,22 @@ private[mxnet] object NDArrayMacro {
     structGeneration(c)(functionDefs, annottees : _*)
   }
 
+  /**
+    * Implementation for Dynamic typed API NDArray.random.<functioname>
+    */
+  private def typeSafeRandomAPIImpl(c: blackbox.Context)(annottees: 
c.Expr[Any]*): c.Expr[Any] = {
+    import c.universe._
+
+    val rndFunctions =
+      ndarrayFunctions.filter(f => f.name.startsWith("_sample_") || 
f.name.startsWith("_random_"))
+
+    val functionDefs = rndFunctions.map(f => buildTypeSafeFunction(c)(f))
+    structGeneration(c)(functionDefs, annottees: _*)
 
 Review comment:
   The possible way to do it is maybe apply some regex pattern as a param to 
reconstruct the way you want to represent this.

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