fix a bug in nlp: text_matching/sentence_transformers when last dim is 1 and reduce mid dim (#34941)
fix a bug in nlp: text_matching/sentence_transformers when last dim is 1 and reduce mid dim (#34941)


PaddlePaddle/Paddle,PaddlePaddle/Paddle,PaddlePaddle/Paddle,PaddlePaddle/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,luotao1/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,luotao1/Paddle,luotao1/Paddle,luotao1/Paddle