yzhliu commented on a change in pull request #10660: [MXNET-357] New Scala API
Design (Symbol)
URL: https://github.com/apache/incubator-mxnet/pull/10660#discussion_r187465827
##########
File path:
scala-package/macros/src/main/scala/org/apache/mxnet/SymbolMacro.scala
##########
@@ -21,109 +21,155 @@ import scala.annotation.StaticAnnotation
import scala.collection.mutable.ListBuffer
import scala.language.experimental.macros
import scala.reflect.macros.blackbox
-
import org.apache.mxnet.init.Base._
import org.apache.mxnet.utils.OperatorBuildUtils
private[mxnet] class AddSymbolFunctions(isContrib: Boolean) extends
StaticAnnotation {
private[mxnet] def macroTransform(annottees: Any*) = macro
SymbolImplMacros.addDefs
}
+private[mxnet] class AddSymbolAPIs(isContrib: Boolean) extends
StaticAnnotation {
+ private[mxnet] def macroTransform(annottees: Any*) = macro
SymbolImplMacros.addNewDefs
+}
+
private[mxnet] object SymbolImplMacros {
- case class SymbolFunction(handle: SymbolHandle, keyVarNumArgs: String)
+ case class SymbolArg(argName: String, argType: String, isOptional : Boolean)
+ case class SymbolFunction(name: String, listOfArgs: List[SymbolArg])
// scalastyle:off havetype
def addDefs(c: blackbox.Context)(annottees: c.Expr[Any]*) = {
- impl(c)(false, annottees: _*)
+ impl(c)(annottees: _*)
}
- // scalastyle:off havetype
+ def addNewDefs(c: blackbox.Context)(annottees: c.Expr[Any]*) = {
+ newAPIImpl(c)(annottees: _*)
Review comment:
can we have a more meaningful name, for example, `typeSafeAPI`?
----------------------------------------------------------------
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