The seq2seq implementation of mean and max pooling crashes using allennlp 2.7 and pytorch 1,8
The issue is that both mean and max pooling mask the encoded output by converting the original mask from bool to float and multiplying. This masked tensor is then passed to masked_mean or masked_max along with the float mask, but masked_mean or masked_max require a bool mask, 'masked_max` fails on the first line
vector.masked_fill(~mask, min_value_of_dtype(vector.dtype))
It seems unnecessary in the first place to mask the embeddings since that's done in masked_mean or masked_max
The
seq2seqimplementation of mean and max pooling crashes using allennlp 2.7 and pytorch 1,8The issue is that both mean and max pooling mask the encoded output by converting the original mask from
booltofloatand multiplying. This masked tensor is then passed tomasked_meanormasked_maxalong with the float mask, butmasked_meanormasked_maxrequire a bool mask, 'masked_max` fails on the first linevector.masked_fill(~mask, min_value_of_dtype(vector.dtype))It seems unnecessary in the first place to mask the embeddings since that's done in
masked_meanormasked_max