Why is the CrossEntropyLoss ignore_index set to sequence length in BertForQuestionAnswering
Hello,I had a question when going through the implementation of BERT for question answering.InL1876in the implementation ofBertForQuestionAnsweringthe loss is calculated.The variableignored_indexshould be the sequence length, as it is used to clamp thestart_positionsandend_positionsin the previous lines.I was wondering why theignore_indexis set toignored_index(==the sequence length) instead of leaving it at the default (-100)?