From acbc87666f12ba661b3f5143dc2ef7306081e843 Mon Sep 17 00:00:00 2001 From: CoTea <1847341168@qq.com> Date: Mon, 2 Dec 2024 03:17:09 +0000 Subject: [PATCH] =?UTF-8?q?BatchMatMul=20=E7=B1=BB=E8=A6=81=E6=B1=82=20?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E7=9A=84=E4=B8=A4=E4=B8=AA=20Tensor=20?= =?UTF-8?q?=E7=9A=84=E7=BB=B4=E5=BA=A6=E7=9B=B8=E5=90=8C=EF=BC=8C=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E4=B8=8A=E4=B8=8B=E6=96=87=E7=90=86=E8=A7=A3=E5=BA=94?= =?UTF-8?q?=E6=94=B9=E4=B8=BAout=20=3D=20self.matmul(x,=20ms.numpy.broadca?= =?UTF-8?q?st=5Fto(self.weight,=20x.shape[:-2]=20=20=20self.weight.shape))?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: CoTea <1847341168@qq.com> --- docs/mindspore/source_zh_cn/model_infer/ms_infer/parallel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/mindspore/source_zh_cn/model_infer/ms_infer/parallel.md b/docs/mindspore/source_zh_cn/model_infer/ms_infer/parallel.md index 756dacdede..e8553bb9d0 100644 --- a/docs/mindspore/source_zh_cn/model_infer/ms_infer/parallel.md +++ b/docs/mindspore/source_zh_cn/model_infer/ms_infer/parallel.md @@ -147,7 +147,7 @@ def construct(self, x): origin_dtype = x.dtype x = self.cast(x, self.dtype) - out = self.matmul(x, self.weight) + out = self.matmul(x, ms.numpy.broadcast_to(self.weight, x.shape[:-2] + self.weight.shape)) if self.has_bias: output_parallel = self.bias_add( output_parallel, self.cast(self.bias, self.dtype) -- Gitee