forked from mindspore-Ecosystem/mindspore
!14178 [MS][LITE][Develop]fix name of tensor from StringToTensor
From: @lx0095 Reviewed-by: @zhang_xue_tong,@hangangqiang Signed-off-by: @zhang_xue_tong
This commit is contained in:
commit
b70a442063
|
@ -23,6 +23,10 @@
|
|||
namespace mindspore {
|
||||
|
||||
Status Model::Build(GraphCell graph, const std::shared_ptr<Context> &model_context) {
|
||||
if (impl_ != nullptr) {
|
||||
MS_LOG(DEBUG) << "Model has been already built.";
|
||||
return kSuccess;
|
||||
}
|
||||
impl_ = std::shared_ptr<ModelImpl>(new (std::nothrow) ModelImpl());
|
||||
if (impl_ == nullptr) {
|
||||
MS_LOG(ERROR) << "Model implement is null.";
|
||||
|
|
|
@ -37,10 +37,6 @@ using mindspore::lite::RET_OK;
|
|||
|
||||
Status ModelImpl::Build() {
|
||||
MS_LOG(DEBUG) << "Start build model.";
|
||||
if (session_ != nullptr) {
|
||||
MS_LOG(DEBUG) << "Model has been already built.";
|
||||
return kSuccess;
|
||||
}
|
||||
auto model = graph_->graph_data_->lite_model();
|
||||
if (graph_ == nullptr || graph_->graph_data_ == nullptr || model == nullptr) {
|
||||
MS_LOG(ERROR) << "Invalid graph.";
|
||||
|
|
|
@ -67,14 +67,14 @@ MSTensor::Impl *MSTensor::Impl::StringsToTensorImpl(const std::string &name, con
|
|||
delete lite_tensor;
|
||||
return nullptr;
|
||||
}
|
||||
auto impl = new (std::nothrow) Impl();
|
||||
auto impl = new (std::nothrow) Impl(lite_tensor);
|
||||
if (impl == nullptr) {
|
||||
delete lite_tensor;
|
||||
MS_LOG(ERROR) << "Failed to allocate tensor impl.";
|
||||
return nullptr;
|
||||
}
|
||||
impl->set_lite_tensor(lite_tensor);
|
||||
impl->set_own_data(true);
|
||||
impl->set_from_session(false);
|
||||
return impl;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue