Thank you Thomas. I might be testing your patience now but I have data like:
max_words, data_sz, max_len = 75000, 1000000, 75
train_X = torch.randint(0, max_words, (data_sz, max_len), dtype=torch.long)

The value of the id in train_X will direct it to a corresponding row in an embedding matrix. We wish to use 2 embedding matrices and of the 75,000 ids in train_X, say, 15,000 of them are out of vocab. We thus wish to efficiently direct these ids to another embedding somehow …i.e. re-indexing them so they are numbered between 0-15,000 - I’m still not clear on this.
Hope this makes sense - I have another thing to try if this fails so no worries either way.
Mark