Open FOXaaFOX opened 4 years ago
x = x.squeeze()
change:
x = x.view(batch_size, 2*filter_num)
dpccn这个模型,max_seq_length不能是任意数。 不然经过self._block(x)这个模块后,得到的形状不是[batch_size, filter_num],而是[batch_size, filter_num, 2] max_seq_length设置成,减2后,不断除2,得到的结果是1不是2,就行。
x = x.squeeze()
x: [batch_size, filter_num]
change:
x = x.view(batch_size, 2*filter_num)
x: [batch_size,2* filter_num]