Skip to content

Commit

Permalink
[ATLAS] Fix Atlas func return BUG, remove destroy old desc code
Browse files Browse the repository at this point in the history
  • Loading branch information
doxutx committed May 11, 2024
1 parent b9136bb commit 49ed37c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions source/tnn/device/atlas/atlas_network.cc
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ Status AtlasNetwork::DeduceOMModelAIPPInputFormat() {
this->om_model_info_->aipp_input_format_map[input_name] = aipp_info.inputFormat;
}
}
return TNN_OK;
}

Status AtlasNetwork::InitOMModel(ModelConfig &model_config, AbstractModelInterpreter *interpreter,
Expand Down Expand Up @@ -1003,13 +1004,14 @@ Status AtlasNetwork::SetRangeDynamicInputDim(std::string input_name, const DimsV
return Status(TNNERR_ATLAS_RUNTIME_ERROR, "get dynamic batch input index falied");
}

// Deprecated in CANN 7+ Version
// Get & Destroy Old Output TensorDesc
aclTensorDesc* old_input_desc = aclmdlGetDatasetTensorDesc(this->aclmdl_input_dataset_, index);
if (old_input_desc == nullptr) {
LOGE("failed to get existing TensorDesc for input '%s'.\n", input_name.c_str());
return Status(TNNERR_ATLAS_RUNTIME_ERROR, "failed to get existing TensorDesc for dynamic input.");
}
aclDestroyTensorDesc(old_input_desc);
//aclTensorDesc* old_input_desc = aclmdlGetDatasetTensorDesc(this->aclmdl_input_dataset_, index);
//if (old_input_desc == nullptr) {
// LOGE("failed to get existing TensorDesc for input '%s'.\n", input_name.c_str());
// return Status(TNNERR_ATLAS_RUNTIME_ERROR, "failed to get existing TensorDesc for dynamic input.");
//}
//aclDestroyTensorDesc(old_input_desc);

// Create & Set New Output TensorDesc
int64_t dim_arr[target_input_shape.size()];
Expand Down

0 comments on commit 49ed37c

Please sign in to comment.