atulkum / pointer_summarizer

pytorch implementation of "Get To The Point: Summarization with Pointer-Generator Networks"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Index of Out Bound Error in doing scatter_add when we have OOV words

tim5go opened this issue · comments

final_dist = vocab_dist_.scatter_add(1, enc_batch_extend_vocab, attn_dist_)

I am using another dataset to train the model, I observed that if we have OOV words, the value in enc_batch_extend_vocab could be larger than the length of vocab_dist_, which causing like index out of bound error.

Is it better to patch those wordID to zero if it is larger than the size of Vocab?

Yes you are right.