The issue is the requested view dimensions don’t match up; even with -1 as a free dimension, the torch.cat((sample_features_ext,batch_features_ext),2) has a shape that is not a multiple of 128x19x19 (46208) so it cannot be “reshaped” to [?, 128, 19, 19].