!48971 Quantile add null check

Merge pull request !48971 from Bokai Li/dev_2_08_sparsereorder
This commit is contained in:
i-robot 2023-02-16 11:18:56 +00:00 committed by Gitee
commit 777e771a48
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 4 additions and 0 deletions

View File

@ -173,6 +173,10 @@ template <typename T>
bool QuantileCpuKernelMod::LaunchKernel(const std::vector<kernel::AddressPtr> &inputs,
const std::vector<kernel::AddressPtr> &workspace,
const std::vector<kernel::AddressPtr> &outputs) {
if (inputs[kIndex1]->size == 0) {
MS_EXCEPTION(ValueError) << "For Quantile, q-th must be non-empty";
}
CHECK_KERNEL_INPUTS_NUM(inputs.size(), kQuantileInputsNum, kernel_name_);
CHECK_KERNEL_OUTPUTS_NUM(outputs.size(), kQuantileOutputsNum, kernel_name_);