diff --git a/mindspore/ccsrc/plugin/device/gpu/kernel/math/renorm_gpu_kernel.cc b/mindspore/ccsrc/plugin/device/gpu/kernel/math/renorm_gpu_kernel.cc index b95b41580d1..c4aa029fc36 100644 --- a/mindspore/ccsrc/plugin/device/gpu/kernel/math/renorm_gpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/gpu/kernel/math/renorm_gpu_kernel.cc @@ -34,14 +34,12 @@ bool RenormGpuKernelMod::GetRenormAttr(const BaseOperatorPtr &base_operator) { dim_ = GetValue(base_operator->GetAttr("dim")); p_ = GetValue(base_operator->GetAttr("p")); if (p_ <= 0.0f) { - MS_LOG(ERROR) << "For '" << kernel_name_ << "', it's op attribute 'p'" << p_ - << "less than or equals to zero is invalid."; + MS_LOG(ERROR) << "For 'Renorm', it's op attribute 'p'" << p_ << "less than or equals to zero is invalid."; return false; } max_norm_ = GetValue(base_operator->GetAttr("maxnorm")); if (max_norm_ < 0) { - MS_LOG(ERROR) << "For '" << kernel_name_ << "', it's op attribute 'maxnorm'" << max_norm_ - << "less than zero is invalid."; + MS_LOG(ERROR) << "For 'Renorm', it's op attribute 'maxnorm'" << max_norm_ << "less than zero is invalid."; return false; } return true; @@ -102,8 +100,8 @@ void RenormGpuKernelMod::InitParams() { auto shape_size = input_shape_.size(); MS_EXCEPTION_IF_ZERO("input shape", shape_size); if (dim_ >= SizeToLong(shape_size) || dim_ < -SizeToLong(shape_size)) { - MS_LOG(EXCEPTION) << "For '" << kernel_name_ << "', it's op attribute 'dim' must be in range [" << -shape_size - << ", " << shape_size << "), but got " << dim_; + MS_LOG(EXCEPTION) << "For 'Renorm', it's op attribute 'dim' must be in range [" << -SizeToLong(shape_size) << ", " + << shape_size << "), but got " << dim_; } if (dim_ < 0) { dim_ += shape_size; diff --git a/mindspore/python/mindspore/ops/operations/math_ops.py b/mindspore/python/mindspore/ops/operations/math_ops.py index d4f565706c8..56374575bca 100644 --- a/mindspore/python/mindspore/ops/operations/math_ops.py +++ b/mindspore/python/mindspore/ops/operations/math_ops.py @@ -6373,7 +6373,7 @@ class Renorm(Primitive): Refer to :func::`mindspore.ops.renorm` for more detail. Supported Platforms: - ``Ascend`` ``CPU`` + ``Ascend`` ``CPU`` ``GPU`` Examples: >>> x = Tensor(np.array([[1, 1, 1], [2, 2, 2], [3, 3, 3]]), mindspore.float32)