-
Notifications
You must be signed in to change notification settings - Fork 637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding one hot operator #684
Conversation
Codecov Report
@@ Coverage Diff @@
## master #684 +/- ##
============================================
+ Coverage 68.53% 68.59% +0.05%
- Complexity 3928 3932 +4
============================================
Files 461 461
Lines 18220 18222 +2
Branches 1963 1963
============================================
+ Hits 12487 12499 +12
+ Misses 4716 4706 -10
Partials 1017 1017
Continue to review full report at Codecov.
|
* @param dataType dataType of the output. | ||
* @return one-hot encoding of this {@code NDArray} | ||
*/ | ||
NDArray oneHot(int depth, float onValue, float offValue, DataType dataType); |
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.
Is this operator commonly used in the mathmatical operations? Or it is jusr for BERT model?
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.
Description
Adding the one hot operator. This is similar to https://mxnet.apache.org/versions/1.6/api/r/docs/api/mx.nd.one.hot.html