Line 26 of Attention_Pooling.py contains:
attention_weights = F.tanh(lin_out.bmm(v_view).squeeze())
This unspecified squeeze will eliminate the batch # dimension if performing inference on a single input since it would be 1.
I'm proposing this line should be changed to:
Line 26 of Attention_Pooling.py contains:
attention_weights = F.tanh(lin_out.bmm(v_view).squeeze())
This unspecified squeeze will eliminate the batch # dimension if performing inference on a single input since it would be 1. I'm proposing this line should be changed to:
attention_weights = F.tanh(lin_out.bmm(v_view).squeeze(2))
Simply specifying the dimension of this squeeze should fix the problem :).