Browse Source

Merge branch 'development' of https://gitee.com/wan_xuelei/graphengine into development

pull/127/head
wxl 5 years ago
parent
commit
f13697e7af
2 changed files with 14 additions and 3 deletions
  1. +13
    -3
      ge/generator/ge_generator.cc
  2. +1
    -0
      inc/framework/generator/ge_generator.h

+ 13
- 3
ge/generator/ge_generator.cc View File

@@ -538,9 +538,9 @@ namespace {
return is_need; return is_need;
} }
} }
Status GeGenerator::BuildSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &inputs, const vector<GeTensor> &outputs,
const string &model_file_name, OpEngineType engine_type, ModelBufferData &model_buff,
bool is_offline) {
Status GeGenerator::CheckForSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &inputs,
const vector<GeTensor> &outputs) {
GE_CHECK_NOTNULL_EXEC(op_desc, return PARAM_INVALID); GE_CHECK_NOTNULL_EXEC(op_desc, return PARAM_INVALID);
if (!inputs.empty() && (inputs.size() != op_desc->GetAllInputsSize())) { if (!inputs.empty() && (inputs.size() != op_desc->GetAllInputsSize())) {
GELOGE(PARAM_INVALID, "Tensor size: %zu, Inputs size: %zu", inputs.size(), op_desc->GetAllInputsSize()); GELOGE(PARAM_INVALID, "Tensor size: %zu, Inputs size: %zu", inputs.size(), op_desc->GetAllInputsSize());
@@ -550,7 +550,17 @@ Status GeGenerator::BuildSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &in
GELOGE(PARAM_INVALID, "Tensor size: %zu, Outputs size: %zu", outputs.size(), op_desc->GetOutputsSize()); GELOGE(PARAM_INVALID, "Tensor size: %zu, Outputs size: %zu", outputs.size(), op_desc->GetOutputsSize());
return PARAM_INVALID; return PARAM_INVALID;
} }
return SUCCESS;
}


Status GeGenerator::BuildSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &inputs, const vector<GeTensor> &outputs,
const string &model_file_name, OpEngineType engine_type, ModelBufferData &model_buff,
bool is_offline) {

if (CheckForSingleOp(op_desc, inputs, outputs) != SUCCESS) {
GELOGE(PARAM_INVALID, "input param is invalid when build single op!");
return PARAM_INVALID;
}
OmgContext &omg_context = (impl_ == nullptr) ? domi::GetContext() : impl_->omg_context_; OmgContext &omg_context = (impl_ == nullptr) ? domi::GetContext() : impl_->omg_context_;
omg_context.is_dynamic_input = ContainsDynamicInpus(*op_desc); omg_context.is_dynamic_input = ContainsDynamicInpus(*op_desc);




+ 1
- 0
inc/framework/generator/ge_generator.h View File

@@ -87,6 +87,7 @@ class GeGenerator {
Status BuildSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &inputs, const vector<GeTensor> &outputs, Status BuildSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &inputs, const vector<GeTensor> &outputs,
const string &model_file_name, OpEngineType engine_type, const string &model_file_name, OpEngineType engine_type,
ModelBufferData &model_buff, bool is_offline = true); ModelBufferData &model_buff, bool is_offline = true);
Status CheckForSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &inputs, const vector<GeTensor> &outputs);


class Impl; class Impl;




Loading…
Cancel
Save