You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add permute_duplicate_pooled_embeddings op for CPU (pytorch#1939)
Summary:
Pull Request resolved: pytorch#1939
This diff builds ontop of the pervious diff and adds support for permute_duplicate_pooled_embeddings for CPU.
# Background
Currently permute_pooled_embs_gpu does not support duplicates in a permutation, this poses a problem with passing the same embeddings to multiple modules. This doc proposes a solution to allow duplicate subsets in the resultant permutation.
# Details
The required implementation of permute_duplicate_pooled_embs_gpu should support a subset being repeated. This is represented by having duplicates in the permute list. This also results in the output list size being greater than the input list.
Input: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Offset_dims: [0, 2, 5, 6, 10]
Permute: [3, 0, 2, 1, 3]
Output: [6, 7, 8, 9, 0, 1, 5, 2, 3, 4, 6, 7, 8, 9]
Differential Revision: D48305145
fbshipit-source-id: 0e6e325eab8f1907991c22594a32e8f0937a914f
0 commit comments