forked from mindspore-Ecosystem/mindspore
fuzz check
This commit is contained in:
parent
09ace3e825
commit
a5e643232e
|
@ -25,6 +25,9 @@ int TensorListGetItemInferShape(const TensorC *const *inputs, size_t inputs_size
|
||||||
return check_ret;
|
return check_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (inputs[0]->data_type_ != kObjectTypeTensorType) {
|
||||||
|
return NNACL_ERR;
|
||||||
|
}
|
||||||
TensorListC *input0 = (TensorListC *)(inputs[0]);
|
TensorListC *input0 = (TensorListC *)(inputs[0]);
|
||||||
const TensorC *get_index = inputs[1];
|
const TensorC *get_index = inputs[1];
|
||||||
if (get_index->data_ == NULL) {
|
if (get_index->data_ == NULL) {
|
||||||
|
|
|
@ -360,6 +360,12 @@ bool LiteOpActor::NeedResize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int LiteOpActor::InitInputData() {
|
int LiteOpActor::InitInputData() {
|
||||||
|
for (size_t i = 0; i < inputs_data_.size(); ++i) {
|
||||||
|
if (inputs_data_[i] == nullptr) {
|
||||||
|
MS_LOG(ERROR) << "inputs_data_ nullptr, index: " << i;
|
||||||
|
return RET_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
bool need_resize = NeedResize();
|
bool need_resize = NeedResize();
|
||||||
auto ret = SetInputShape();
|
auto ret = SetInputShape();
|
||||||
MS_CHECK_FALSE_MSG(ret != RET_OK, ret, "Set input shape failed.");
|
MS_CHECK_FALSE_MSG(ret != RET_OK, ret, "Set input shape failed.");
|
||||||
|
|
|
@ -128,6 +128,10 @@ int MindrtExecutor::PrepareGraphOutput(const std::vector<kernel::KernelExec *> &
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (output_data_.empty()) {
|
||||||
|
MS_LOG(ERROR) << "output_data_ can not be empty.";
|
||||||
|
return RET_ERROR;
|
||||||
|
}
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ constexpr int kLstmBiasShapeSize = 2;
|
||||||
constexpr int kLstmBiasIndex = 3;
|
constexpr int kLstmBiasIndex = 3;
|
||||||
constexpr size_t kGatherAxisIndex = 3;
|
constexpr size_t kGatherAxisIndex = 3;
|
||||||
constexpr size_t kAnfPrimitiveIndex = 0;
|
constexpr size_t kAnfPrimitiveIndex = 0;
|
||||||
|
constexpr int kDefaultThreadNumFour = 4;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
QuantParamHolderPtr GetCNodeQuantHolder(const CNodePtr &cnode) {
|
QuantParamHolderPtr GetCNodeQuantHolder(const CNodePtr &cnode) {
|
||||||
|
@ -304,13 +305,20 @@ Status BuildModelByFuncGraph(const std::shared_ptr<mindspore::Model> &model, con
|
||||||
return kLiteNullptr;
|
return kLiteNullptr;
|
||||||
}
|
}
|
||||||
auto context = std::make_shared<mindspore::Context>();
|
auto context = std::make_shared<mindspore::Context>();
|
||||||
context->SetThreadAffinity(kCpuBindMode);
|
|
||||||
if (context == nullptr) {
|
if (context == nullptr) {
|
||||||
MS_LOG(ERROR) << "New context failed while running.";
|
MS_LOG(ERROR) << "New context failed while running.";
|
||||||
delete meta_graph;
|
delete meta_graph;
|
||||||
return kLiteNullptr;
|
return kLiteNullptr;
|
||||||
}
|
}
|
||||||
|
context->SetThreadAffinity(kCpuBindMode);
|
||||||
|
context->SetThreadNum(kDefaultThreadNumFour);
|
||||||
|
|
||||||
std::shared_ptr<CPUDeviceInfo> device_info = std::make_shared<CPUDeviceInfo>();
|
std::shared_ptr<CPUDeviceInfo> device_info = std::make_shared<CPUDeviceInfo>();
|
||||||
|
if (device_info == nullptr) {
|
||||||
|
MS_LOG(ERROR) << "New device_info failed while running.";
|
||||||
|
delete meta_graph;
|
||||||
|
return kLiteNullptr;
|
||||||
|
}
|
||||||
auto &device_list = context->MutableDeviceInfo();
|
auto &device_list = context->MutableDeviceInfo();
|
||||||
device_list.push_back(device_info);
|
device_list.push_back(device_info);
|
||||||
auto ret = model->Build(content, *size, kMindIR, context);
|
auto ret = model->Build(content, *size, kMindIR, context);
|
||||||
|
|
Loading…
Reference in New Issue