mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
Drop quant_util.h and move helper function into quantization.h (#8747)
This commit is contained in:
parent
d0ff2621ee
commit
93e1e1dfa1
4 changed files with 14 additions and 24 deletions
|
|
@ -5,7 +5,7 @@
|
|||
#include "core/providers/cpu/math/gemm_base.h"
|
||||
#include "core/providers/cpu/math/gemm_helper.h"
|
||||
#include "core/providers/cpu/math/matmul_integer_base.h"
|
||||
#include "core/quantization/quant_util.h"
|
||||
#include "core/quantization/quantization.h"
|
||||
#include "core/util/math_cpuonly.h"
|
||||
|
||||
namespace onnxruntime {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "core/framework/op_kernel.h"
|
||||
#include "core/mlas/inc/mlas.h"
|
||||
#include "core/providers/common.h"
|
||||
#include "core/quantization/quant_util.h"
|
||||
#include "core/quantization/quantization.h"
|
||||
|
||||
namespace onnxruntime {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/common/common.h"
|
||||
#include "core/mlas/inc/mlas.h"
|
||||
#include "core/framework/allocator.h"
|
||||
#include "core/framework/buffer_deleter.h"
|
||||
|
||||
namespace onnxruntime {
|
||||
namespace quantization {
|
||||
// Transpose the input and store it to a new allocated buffer
|
||||
inline uint8_t* TransPoseInputData(const uint8_t* input, BufferUniquePtr& buffer_holder, AllocatorPtr& allocator, size_t M, size_t N) {
|
||||
uint8_t* output = static_cast<uint8_t*>(allocator->Alloc(M * N * sizeof(uint8_t)));
|
||||
MlasTranspose(input, output, M, N);
|
||||
buffer_holder.reset(output);
|
||||
return output;
|
||||
}
|
||||
|
||||
} // namespace quantization
|
||||
} // namespace onnxruntime
|
||||
|
|
@ -186,5 +186,17 @@ void Dequantize(const std::vector<T>& values,
|
|||
Dequantize(values.data(), output.data(), params, values.size());
|
||||
}
|
||||
|
||||
// Transpose the input and store it to a new allocated buffer.
|
||||
inline uint8_t* TransPoseInputData(const uint8_t* input,
|
||||
BufferUniquePtr& buffer_holder,
|
||||
AllocatorPtr& allocator,
|
||||
size_t M,
|
||||
size_t N) {
|
||||
uint8_t* output = static_cast<uint8_t*>(allocator->Alloc(M * N * sizeof(uint8_t)));
|
||||
MlasTranspose(input, output, M, N);
|
||||
buffer_holder.reset(output);
|
||||
return output;
|
||||
}
|
||||
|
||||
} // namespace quantization
|
||||
} // namespace onnxruntime
|
||||
|
|
|
|||
Loading…
Reference in a new issue