From 2b391b228583793cacd73ae9087c18cf887492fb Mon Sep 17 00:00:00 2001 From: huanghui Date: Thu, 9 Feb 2023 20:28:00 +0800 Subject: [PATCH] make shape to {1} for Svd's u,v if compute_uv is False --- .../ccsrc/plugin/device/gpu/kernel/math/svd_gpu_kernel.cc | 4 ++-- mindspore/core/ops/svd.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mindspore/ccsrc/plugin/device/gpu/kernel/math/svd_gpu_kernel.cc b/mindspore/ccsrc/plugin/device/gpu/kernel/math/svd_gpu_kernel.cc index 2f600c46d32..74e178acfe7 100644 --- a/mindspore/ccsrc/plugin/device/gpu/kernel/math/svd_gpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/gpu/kernel/math/svd_gpu_kernel.cc @@ -87,8 +87,8 @@ void SvdGpuKernelMod::InitSizeLists() { output_size_list_.push_back(batch_size_ * n_ * p_ * unit_size_); } } else { - output_size_list_.push_back(0); - output_size_list_.push_back(0); + output_size_list_.push_back(1); + output_size_list_.push_back(1); } // for dev_info workspace_size_list_.push_back(batch_size_ * sizeof(int)); diff --git a/mindspore/core/ops/svd.cc b/mindspore/core/ops/svd.cc index 3b641dfcb73..fe9721c06f3 100644 --- a/mindspore/core/ops/svd.cc +++ b/mindspore/core/ops/svd.cc @@ -65,8 +65,8 @@ abstract::BaseShapePtr SvdInferShape(const PrimitivePtr &prim, const std::vector v_shape[v_shape.size() - kIndexOne] = p; } } else { - u_shape = {0}; - v_shape = {0}; + u_shape = {1}; + v_shape = {1}; } std::vector shape_tuple;