!43690 [MSLite][CPU]Fuzz Fix
Merge pull request !43690 from 陈宇/dev_master_fuzz_fix
This commit is contained in:
commit
bbd5354459
|
@ -26,6 +26,10 @@ int HashtableLoopupInferShape(const TensorC *const *inputs, size_t inputs_size,
|
|||
|
||||
const TensorC *input = inputs[0];
|
||||
const TensorC *values = inputs[2];
|
||||
if (input == NULL || values == NULL) {
|
||||
return NNACL_NULL_PTR;
|
||||
}
|
||||
|
||||
TensorC *output = outputs[0];
|
||||
TensorC *hits = outputs[1];
|
||||
|
||||
|
|
|
@ -331,6 +331,9 @@ Status ModelImpl::Predict(const std::vector<MSTensor> &inputs, std::vector<MSTen
|
|||
return kLiteError;
|
||||
}
|
||||
std::vector<void *> old_data;
|
||||
for (size_t i = 0; i < inputs.size(); i++) {
|
||||
old_data.push_back(input_tensors.at(i)->data());
|
||||
}
|
||||
for (size_t i = 0; i < inputs.size(); i++) {
|
||||
auto input = input_tensors.at(i);
|
||||
auto user_input = inputs.at(i);
|
||||
|
@ -349,7 +352,6 @@ Status ModelImpl::Predict(const std::vector<MSTensor> &inputs, std::vector<MSTen
|
|||
MS_LOG(WARNING) << "Tensor " << user_input.Name() << " has a different name from input" << input->tensor_name()
|
||||
<< ".";
|
||||
}
|
||||
old_data.push_back(input->data());
|
||||
if (input->data_type() == kObjectTypeString) {
|
||||
#ifndef STRING_KERNEL_CLIP
|
||||
std::vector<int32_t> shape = TruncateShape(user_input.Shape(), input->data_type(), user_input.DataSize(), false);
|
||||
|
|
|
@ -214,6 +214,14 @@ int ScaleInt8CPUKernel::Prepare() {
|
|||
return RET_ERROR;
|
||||
}
|
||||
|
||||
for (auto tensor : in_tensors_) {
|
||||
if (tensor->data_type() != TypeId::kNumberTypeInt8) {
|
||||
MS_LOG(ERROR) << " in tensors type to scale_int8 should be int8, but type id " << tensor->data_type()
|
||||
<< " is given";
|
||||
}
|
||||
return RET_ERROR;
|
||||
}
|
||||
|
||||
if (!InferShapeDone()) {
|
||||
return RET_OK;
|
||||
}
|
||||
|
|
|
@ -269,6 +269,7 @@ int BenchmarkUnifiedApi::GenerateInputData() {
|
|||
return RET_ERROR;
|
||||
}
|
||||
tensor = *input;
|
||||
delete input;
|
||||
} else {
|
||||
auto input_data = tensor.MutableData();
|
||||
if (input_data == nullptr) {
|
||||
|
|
Loading…
Reference in New Issue