!39150 fix scalar type compute of maximum and pclint issue.

Merge pull request !39150 from yangshuo/br_pclint
This commit is contained in:
i-robot 2022-08-02 01:59:11 +00:00 committed by Gitee
commit 1b956ec349
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 1 additions and 5 deletions

View File

@ -78,7 +78,7 @@ bool ArgmaxCpuKernelMod::LaunchKernel(const std::vector<kernel::AddressPtr> &inp
}
bool ArgmaxCpuKernelMod::Init(const BaseOperatorPtr &base_operator, const std::vector<KernelTensorPtr> &inputs,
const std::vector<KernelTensorPtr> &outputs) {
const std::vector<KernelTensorPtr> &) {
auto kernel_ptr = std::dynamic_pointer_cast<ops::ArgMax>(base_operator);
if (!kernel_ptr) {
MS_LOG(ERROR) << "cast ArgMax ops failed!";

View File

@ -77,10 +77,6 @@ int MaximumCpuKernelMod::Resize(const BaseOperatorPtr &base_operator, const std:
InitInputTensorAndScalar(max_input_shape_size);
} else if (max_input_shape_size == output_shape_.size() && output_shape_.size() != 0) {
InitInputTensors(input_x_dtype, input_y_dtype);
} else {
MS_LOG(WARNING) << "For '" << kernel_name_ << "', inputs must be two tensors or one tensor and one scalar, but got "
<< input_x_dtype << " and " << input_y_dtype;
return KRET_RESIZE_FAILED;
}
return 0;
}