Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
#include "simple_tensor_allocator.h"
#include "tensorprotoutils.h"
 
namespace onnxruntime {
common::Status SimpleTensorAllocator::Trace(int /*id*/, const ONNX_NAMESPACE::TensorProto* /*value*/) {
  return Status::OK();
}
 
common::Status SimpleTensorAllocator::GetPreallocatedBuffer(int ort_value_index, const std::string& /*name*/,
                                                            std::optional<MemBuffer>& /*buf_out*/,
                                                            AllocatorPtr& alloc_out) {
  const struct OrtDevice& location = seq_plan_.GetLocation(ort_value_index);
  // just return allocator and let others handle it.
  alloc_out = GetInitializerAllocator(location);
  return Status::OK();
}
}  // namespace onnxruntime