-
Notifications
You must be signed in to change notification settings - Fork 217
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
implement MaxAuxLabels1(2) #50
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
Great! Sorry dont have time for detailed review... |
OK, let's wait for @csukuangfj 's review. |
csukuangfj
reviewed
Jun 1, 2020
csukuangfj
reviewed
Jun 1, 2020
csukuangfj
reviewed
Jun 1, 2020
csukuangfj
reviewed
Jun 1, 2020
csukuangfj
reviewed
Jun 1, 2020
csukuangfj
reviewed
Jun 1, 2020
csukuangfj
reviewed
Jun 1, 2020
csukuangfj
reviewed
Jun 1, 2020
RE assumptions about epsilons etc.: make sure to document any assumptions.
There may be certain situations where we will want to treat epsilons as
normal symbols.
Important thing now is to make sure everything is clearly documented.
…On Mon, Jun 1, 2020 at 10:12 PM Haowen Qiu ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In k2/csrc/aux_labels.cc
<https://github.com/danpovey/k2/pull/50#discussion_r433258554>:
> +#include <numeric>
+#include <vector>
+
+#include "glog/logging.h"
+#include "k2/csrc/fsa.h"
+
+namespace k2 {
+
+void MapAuxLabels1(const AuxLabels &labels_in,
+ const std::vector<int32_t> &arc_map, AuxLabels *labels_out) {
+ CHECK_NOTNULL(labels_out);
+ auto &start_pos = labels_out->start_pos;
+ auto &labels = labels_out->labels;
+ start_pos.clear();
+ labels.clear();
+
will remove DCHECK_NE(label, kEpsilon) and use insert, I prefer to only
reserve for start_pos here (we may always allocate too much memory (even if
we resize at last) for most of FSA algorithms).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://github.com/danpovey/k2/pull/50#discussion_r433258554>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZFLO5GUUS44OKJWZQG2I3RUOZOFANCNFSM4NPXKR6Q>
.
|
It is documented in .h file, @csukuangfj and I were talking about if we should check labels!=kEpsilon in the implementation (DCHECK). |
I may have changed my mind.. my feeling is if we can treat epsilon the same
as other symbols, and document so, it would be OK.
I have realized there are scenarios where epsilon is best treated as a
normal symbol.
…On Mon, Jun 1, 2020 at 10:24 PM Haowen Qiu ***@***.***> wrote:
It is documented in .h file, @csukuangfj <https://github.com/csukuangfj>
and I were talking about if we should check labels!=kEpsilon in the
implementation (DCHECK).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://github.com/danpovey/k2/pull/50#issuecomment-636890432>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZFLO3R7PMRVDOQEOBFEUTRUO23JANCNFSM4NPXKR6Q>
.
|
OK, I will remove the requirement (labels != kEpsilon) in |
Ready to merge. |
+2 |
Merging. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes in
dense_fsa.h
andfsa.h
are only for passing style check.