RuntimeError: The size of tensor a (11) must match the size of tensor b (7) at non-singleton dimension 3

该报错出现在 ImageGPTModel 开启 add_cross_attention=True 后走编码器-解码器跨注意力(cross-attention)分支的场景,核心是解码器长度与编码器长度在 non-singleton dimension 3 上不匹配;优先排查 ImageGPTModel








