Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
3 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
#pragma once
 
#include <vector>
 
#include "core/common/basic_types.h"
#include "core/common/inlined_containers_fwd.h"
#include "core/framework/allocator.h"
#include "core/framework/tensor_shape.h"
 
namespace onnxruntime {
 
struct PrePackedWeights final {
  // Some weights may be associated with multiple pre-packed buffers (e.g.) QLinearConv.
  // Hence we hold them in container. It is upto the developer implementing each PrePack()
  // method to define what gets stored in which position of the container.
 
  InlinedVector<IAllocatorUniquePtr<void>> buffers_;  // cache pre-packed buffers associated with the kernel
  InlinedVector<size_t> buffer_sizes_;                // cache sizes of pre-packed buffers (in bytes)
 
  // Set when PrePack successfully produced kernel-owned packed weights that
  // intentionally cannot be stored in a shared pre-packed weights container.
  bool has_kernel_owned_packed_weights_{false};
 
  // Produces a hash of the buffers stored in the given instance of this class
  HashValue GetHash() const;
 
  // The function creates a copy with non-owning BufferUniquePtrs.
  PrePackedWeights CreateReferringCopy() const;
};
 
}  // namespace onnxruntime