This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MXNET-531] Custom Operator Example for Scala #11401
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nswamy
reviewed
Jun 29, 2018
|
||
import org.apache.mxnet.{DataIter, IO, Shape} | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no author tags
|
||
@AddSymbolAPIs(false) | ||
/** | ||
* typesafe Symbol API: Symbol.api._ | ||
* Main code will be generated during compile time through Macros | ||
*/ | ||
object SymbolAPI extends SymbolAPIBase { | ||
def Custom (op_type : String, kwargs : mutable.Map[String, Any], | ||
name : String = null, attr : Map[String, String] = null) : Symbol = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should your Custom Op also take optional Seq() for positional arguments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, kwargs
should be able to maintain all customer needs to create a custom Op.
lanking520
force-pushed
the
customop
branch
2 times, most recently
from
July 3, 2018 22:31
c77b804
to
d3f8898
Compare
Can we merge? |
KellenSunderland
pushed a commit
to KellenSunderland/incubator-mxnet
that referenced
this pull request
Jul 21, 2018
Update Custom Operator Example to use new Symbol.api
XinYao1994
pushed a commit
to XinYao1994/incubator-mxnet
that referenced
this pull request
Aug 29, 2018
Update Custom Operator Example to use new Symbol.api
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is the example written in new API in Scala. It include the following two tests:
customOp : Runs only on CPU
customOpRtc: Runs only on GPU
I also add some modification on Macros to disable Custom operator from generation. Instead, I create a Custom Operator in SymbolAPI. Add TODO in NDArray's one.
@nswamy @yzhliu @andrewfayres
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.