forked from pytorch/FBGEMM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add offset-based interface for PyTorch (pytorch#334)
Summary: Pull Request resolved: pytorch#334 Add a variation of embedding operators using offsets rather than lengths. This is for PyTorch EmbeddingBag. Assume the length of offsets is output_size + 1 where offsets[output_size] == indices_size, confirming the standard compressed sparse row (CSR) convention. This diff maintains a backward compatibility (use_offsets = false). We'll have a separate follow-up Caffe2 diff that explicitly passes use_offsets = false, then another diff will change the default of use_offsets to true (making PyTorch as a default). The last diff will break backward compatibility but should be fine because we have only a few call-sites in Caffe2 that we can modify accordingly. Reviewed By: jianyuh Differential Revision: D20746569 fbshipit-source-id: 7530eca8cbf1efb40032ec3e695fb4a64ae13884
- Loading branch information
1 parent
a6e81fb
commit df34258
Showing
13 changed files
with
533 additions
and
300 deletions.
There are no files selected for viewing
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
Oops, something went wrong.