Browse Source

fixing SC

tags/v1.2.0
chuxing 3 years ago
parent
commit
c7b80a1fe6
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      ge/hybrid/model/hybrid_model.cc
  2. +2
    -2
      ge/hybrid/model/hybrid_model_builder.cc

+ 1
- 1
ge/hybrid/model/hybrid_model.cc View File

@@ -341,7 +341,7 @@ TensorValue *HybridModel::GetConstant(const NodePtr &node) const {
return it->second.get(); return it->second.get();
} }


TensorValue * HybridModel::GetTensor(const NodePtr &node) const {
TensorValue *HybridModel::GetTensor(const NodePtr &node) const {
if (node == nullptr) { if (node == nullptr) {
GELOGE(PARAM_INVALID, "Param is null"); GELOGE(PARAM_INVALID, "Param is null");
return nullptr; return nullptr;


+ 2
- 2
ge/hybrid/model/hybrid_model_builder.cc View File

@@ -944,9 +944,9 @@ Status HybridModelBuilder::InitWeights() {
constant_node->GetName().c_str(), constant_node->GetName().c_str(),
tensor_size); tensor_size);


std::shared_ptr<TensorBuffer> tensor_buffer(TensorBuffer::Create(allocator, tensor_size).release());
auto tensor_buffer = TensorBuffer::Create(allocator, tensor_size);
GE_CHECK_NOTNULL(tensor_buffer); GE_CHECK_NOTNULL(tensor_buffer);
std::unique_ptr<TensorValue> constant_tensor(new (std::nothrow)TensorValue(tensor_buffer));
std::unique_ptr<TensorValue> constant_tensor(new (std::nothrow)TensorValue(std::move(tensor_buffer)));
GE_CHECK_NOTNULL(constant_tensor); GE_CHECK_NOTNULL(constant_tensor);
constant_tensor->SetName("Constant_" + op_desc->GetName()); constant_tensor->SetName("Constant_" + op_desc->GetName());
if (tensor_size > 0) { if (tensor_size > 0) {


Loading…
Cancel
Save