From edee9fde8cb86917a5533432836af1769a98eb8c Mon Sep 17 00:00:00 2001 From: chenweitao_295 Date: Fri, 14 Jan 2022 17:06:37 +0800 Subject: [PATCH] fix c++ file issue --- .../kernel_compiler/cpu/searchsorted_cpu_kernel.cc | 2 +- .../backend/kernel_compiler/cpu/slice_cpu_kernel.cc | 4 ++-- .../cpu/sparse_apply_adam_cpu_kernel.cc | 2 +- .../cpu/sparse_apply_ftrl_cpu_kernel.cc | 2 +- .../cpu/sparse_apply_lazy_adam_cpu_kernel.cc | 2 +- .../cpu/sparse_apply_proximal_adagrad_cpu_kernel.cc | 11 +++++++---- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/searchsorted_cpu_kernel.cc b/mindspore/ccsrc/backend/kernel_compiler/cpu/searchsorted_cpu_kernel.cc index 06557904fb7..b77bd15adbc 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/searchsorted_cpu_kernel.cc +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/searchsorted_cpu_kernel.cc @@ -82,7 +82,7 @@ void SearchSortedCPUKernel::CheckParam(const std::vector &inpu if (outputs[0]->size / sizeof(T) != inputs[1]->size / sizeof(S)) { MS_LOG(EXCEPTION) << "For '" << kernel_name_ - << "', the dimensions of input and output should be matched, but got the dimension of input " + << "', the dimension of `v` and output should be equal, but got the dimension of `v` " << inputs[1]->size << " and the dimension of output " << outputs[0]->size; } diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/slice_cpu_kernel.cc b/mindspore/ccsrc/backend/kernel_compiler/cpu/slice_cpu_kernel.cc index 9c4b1ec2bc4..8a3b0535311 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/slice_cpu_kernel.cc +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/slice_cpu_kernel.cc @@ -156,8 +156,8 @@ bool SliceCPUKernel::Launch(const std::vector &inputs, const if (input_shape[i] < LongToSize(begin[i] + size[i])) { MS_LOG(EXCEPTION) << "For '" << kernel_name_ << "', slice shape should be not greater than origin shape. But in dimension i=" << i - << ", origin shape 'input_shape[i]' is " << input_shape[i] - << " and slice shape 'LongToSize(begin[i] + size[i])' is " << LongToSize(begin[i] + size[i]); + << ", origin shape 'input_shape[i]' is " << input_shape[i] << " and slice shape is " + << LongToSize(begin[i] + size[i]); } } InitSliceParam(input_shape, begin, size); diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_adam_cpu_kernel.cc b/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_adam_cpu_kernel.cc index 91e5641b512..e1c2eff1943 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_adam_cpu_kernel.cc +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_adam_cpu_kernel.cc @@ -111,7 +111,7 @@ void SparseApplyAdamCPUKernel::InitKernel(const CNodePtr &kernel_node) { std::vector indices_shape = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 10); if (var_shape.empty()) { MS_LOG(EXCEPTION) << "For '" << kernel_name_ - << "', the dimension of 'var' should be at least 1-D, but got empty tensor."; + << "', the dimension of 'var' should be at least 1-D, but got scalar or None."; } if (!IsSameShape(var_shape, m_shape)) { MS_LOG(EXCEPTION) << "For '" << kernel_name_ diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_ftrl_cpu_kernel.cc b/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_ftrl_cpu_kernel.cc index 69f59b3be21..45cfaa86d52 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_ftrl_cpu_kernel.cc +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_ftrl_cpu_kernel.cc @@ -95,7 +95,7 @@ void SparseApplyFtrlCPUKernel::InitKernel(const CNodePtr &kernel_node) { std::vector grad_shape = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 3); std::vector indices_shape = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 4); if (var_shape.empty()) { - MS_LOG(EXCEPTION) << "For '" << kernel_name_ << "', the 'var' should be at least 1-D, but got empty tensor."; + MS_LOG(EXCEPTION) << "For '" << kernel_name_ << "', the 'var' should be at least 1-D, but got scalar or None."; } if (!IsSameShape(var_shape, accum_shape)) { MS_LOG(EXCEPTION) << "For '" << kernel_name_ diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_lazy_adam_cpu_kernel.cc b/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_lazy_adam_cpu_kernel.cc index 49a0c52cc91..18cf198d325 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_lazy_adam_cpu_kernel.cc +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_lazy_adam_cpu_kernel.cc @@ -91,7 +91,7 @@ void SparseApplyLazyAdamCPUKernel::InitKernel(const CNodePtr &kernel_node) { std::vector indices_shape = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 10); if (var_shape.empty()) { MS_LOG(EXCEPTION) << "For '" << kernel_name_ - << "', the dimension of 'var' should be at least 1-D, but got empty tensor."; + << "', the dimension of 'var' should be at least 1-D, but got scalar or None."; } if (!IsSameShape(var_shape, m_shape)) { MS_LOG(EXCEPTION) << "For '" << kernel_name_ diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_proximal_adagrad_cpu_kernel.cc b/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_proximal_adagrad_cpu_kernel.cc index aa1d1b31595..14da5c01a2a 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_proximal_adagrad_cpu_kernel.cc +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/sparse_apply_proximal_adagrad_cpu_kernel.cc @@ -93,7 +93,7 @@ void SparseApplyProximalAdagradCPUKernel::InitKernel(const CNodePtr &kernel_node std::vector indices_shape = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 6); if (var_shape.empty()) { MS_LOG(EXCEPTION) << "For '" << kernel_name_ - << "', the dimension of 'var' should be at least 1-D, but got empty tensor."; + << "', the dimension of 'var' should be at least 1-D, but got scalar or None."; } if (!IsSameShape(var_shape, accum_shape)) { MS_LOG(EXCEPTION) << "For '" << kernel_name_ @@ -129,15 +129,18 @@ void SparseApplyProximalAdagradCPUKernel::InitKernel(const CNodePtr &kernel_node } if (!lr_shape.empty()) { MS_LOG(EXCEPTION) << "For '" << kernel_name_ - << "', 'lr' should be a scalar, but got the dimension of 'lr': " << Vector2Str(lr_shape); + << "', 'lr' should be a scalar,and dimension of 'lr' should be 0,but got the dimension of 'lr': " + << Vector2Str(lr_shape); } if (!l1_shape.empty()) { MS_LOG(EXCEPTION) << "For '" << kernel_name_ - << "', 'l1' should be a scalar, but got the dimension of 'l1': " << Vector2Str(l1_shape); + << "', 'l1' should be a scalar,and dimension of 'l1' should be 0,but got the dimension of 'l1': " + << Vector2Str(l1_shape); } if (!l2_shape.empty()) { MS_LOG(EXCEPTION) << "For '" << kernel_name_ - << "', 'l2' should be a scalar, but got the dimension of 'l2': " << Vector2Str(l2_shape); + << "', 'l2' should be a scalar,and dimension of 'l2' should be 0,but got the dimension of 'l2': " + << Vector2Str(l2_shape); } indices_data_type_ = AnfAlgo::GetInputDeviceDataType(kernel_node, 6); }