!560 Fix code check

From: @dong-duo
Reviewed-by: @xchu42,@ji_chen
Signed-off-by: @ji_chen
pull/560/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit 3413852064

@ -120,8 +120,8 @@ Status ModelHelper::SaveModelTbeKernel(std::shared_ptr<OmFileSaveHelper> &om_fil
TBEKernelStore tbe_kernel_store = ge_model->GetTBEKernelStore();
GELOGD("TBE_KERNELS size is %zu", tbe_kernel_store.DataSize());
if (tbe_kernel_store.DataSize() > 0) {
GE_CHK_STATUS_RET(SaveModelPartition(om_file_save_helper,
ModelPartitionType::TBE_KERNELS,
GE_CHK_STATUS_RET(
SaveModelPartition(om_file_save_helper, ModelPartitionType::TBE_KERNELS,
ge_model->GetTBEKernelStore().Data(),
ge_model->GetTBEKernelStore().DataSize(), model_index),
"Add tbe kernel partition failed");

@ -2695,8 +2695,9 @@ Status DavinciModel::ReturnResult(uint32_t data_id, const bool rslt_flg, const b
is_getnext_sink_dynamic_ = true;
cur_dynamic_dims_.clear();
cur_dynamic_dims_.resize(shape_of_cur_dynamic_dims_);
GE_CHK_RT_RET(rtMemcpy(cur_dynamic_dims_.data(), shape_of_cur_dynamic_dims_ * sizeof(int64_t),
netoutput_last_input_addr_, netoutput_last_input_size_, RT_MEMCPY_DEVICE_TO_HOST));
auto ret = rtMemcpy(cur_dynamic_dims_.data(), shape_of_cur_dynamic_dims_ * sizeof(int64_t),
netoutput_last_input_addr_, netoutput_last_input_size_, RT_MEMCPY_DEVICE_TO_HOST);
GE_CHK_RT_RET(ret);
}
GELOGD("Cur dynamic dims is %s.", formats::JoinToString(cur_dynamic_dims_).c_str());
if (GenOutputTensorInfo(op_desc, data_index, output_data, outputs) != SUCCESS) {

@ -1089,8 +1089,7 @@ Status ModelManager::GenSessionId(uint64_t &session_id) {
Status ModelManager::LoadModelOffline(uint32_t &model_id, const ModelData &model, shared_ptr<ModelListener> listener,
void *dev_ptr, size_t mem_size, void *weight_ptr, size_t weight_size) {
GE_CHK_BOOL_RET_STATUS(model.key.empty() || mmAccess2(model.key.c_str(), M_F_OK) == EN_OK,
ACL_ERROR_GE_PARAM_INVALID, "input key file path %s is invalid, %s",
model.key.c_str(), strerror(errno));
ACL_ERROR_GE_PARAM_INVALID, "input key file path %s is invalid, %s", model.key.c_str(), strerror(errno));
GenModelId(&model_id);
shared_ptr<DavinciModel> davinci_model = nullptr;

@ -272,6 +272,10 @@ Status StridedSliceKernel::InitParamWithAttrs(const std::vector<ConstGeTensorPtr
void StridedSliceKernel::ExpandDimsWithNewAxis(const ConstGeTensorPtr &begin_tensor, const size_t x_dims_num,
vector<int64_t> &x_dims) {
auto begin_data_type_size = GetSizeByDataType(begin_tensor->GetTensorDesc().GetDataType());
if (begin_data_type_size == 0) {
GELOGW("Param begin_data_type_size should not be zero.");
return;
}
size_t begin_vec_size = begin_tensor->GetData().size() / begin_data_type_size;
auto final_dim_num = x_dims_num < begin_vec_size ? begin_vec_size : x_dims_num;
for (size_t i = 0; i < final_dim_num; i++) {

Loading…
Cancel
Save