Skip to content
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

Merged
merged 10 commits into from
Apr 24, 2021

Conversation

csukuangfj
Copy link
Collaborator

Related to k2-fsa/snowfall#165

I am testing it in snowfall.

@@ -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.
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree.

Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kThreshold.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks

@danpovey
Copy link
Collaborator

You can merge this when it's convenient for you, looks OK.

@csukuangfj csukuangfj merged commit ddf57eb into k2-fsa:master Apr 24, 2021
@csukuangfj csukuangfj deleted the compose-arc-maps branch April 24, 2021 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants