• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2021 Huawei Technologies Co., Ltd
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef MINDSPORE_LITE_MICRO_CODER_OPERATOR_LIBRARY_WRAPPER_FP32_DEQUANT_TO_INT8_FP32_WRAPPER_H_
18 #define MINDSPORE_LITE_MICRO_CODER_OPERATOR_LIBRARY_WRAPPER_FP32_DEQUANT_TO_INT8_FP32_WRAPPER_H_
19 #include <stdint.h>
20 #include <string.h>
21 typedef struct DeQuantArg {
22   float scale;
23   int32_t zeroPoint;
24   float var_corr;
25   float mean_corr;
26   float *clusters;
27   int clusters_nums;
28   int bitNum;
29 } DeQuantArg;
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 void DequantDataPerChannel(const int8_t *quant_src, const DeQuantArg **de_quant_args, size_t de_quant_nums,
36                            size_t per_batch_size, float *de_quant_dst);
37 
38 void DequantData(const int8_t *quant_src, const DeQuantArg **de_quant_args, size_t de_quant_nums, size_t channels,
39                  float *de_quant_dst);
40 
41 void DequantDataPerTensor(const int8_t *quant_src, const DeQuantArg **de_quant_args, size_t de_quant_nums,
42                           float *de_quant_dst);
43 
44 #ifdef __cplusplus
45 }
46 #endif
47 
48 #endif  // MINDSPORE_LITE_MICRO_CODER_OPERATOR_LIBRARY_WRAPPER_FP32_DEQUANT_TO_INT8_FP32_WRAPPER_H_
49