-
Notifications
You must be signed in to change notification settings - Fork 219
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 ComposeArcMaps for 1-D arrays. #726
Conversation
k2/csrc/fsa_utils.h
Outdated
@@ -527,6 +527,21 @@ FsaVec FsaVecFromArcIndexes(FsaVec &fsas, Ragged<int32_t> &best_arc_indexes); | |||
Ragged<int32_t> ComposeArcMaps(Ragged<int32_t> &step1_arc_map, | |||
Ragged<int32_t> &step2_arc_map); | |||
|
|||
/* | |||
Compose arc maps from two successive FSA operations which give arc maps as | |||
a 1-D array. |
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.
I notice the Index() function in array_ops.h is the same as this except it sets the value to 0 instead of -1.
How about adding an extra arg to that function that is the value to be used if the index is -1, defaulting to 0?
I prefer to use general-purpose operations.
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.
Yes, I agree.
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.
Fixed.
temp_storage->data, temp_storage_bytes, src_data, ans_data, n + 1, 0, | ||
n, src_dim, c->GetCudaStream())); | ||
} else { | ||
// split the array and do a recursive call |
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.
Relates to NVIDIA/cub#288
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.
kThreshold.
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.
Fixed. Thanks
You can merge this when it's convenient for you, looks OK. |
Related to k2-fsa/snowfall#165
I am testing it in snowfall.