Skip to content

Commit

Permalink
align the int32_t usage
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorSVC committed Jul 25, 2024
1 parent 7043182 commit 67839ea
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ class BatchNormOpBuilder : public BaseOpBuilder {
}
raw_tensor.resize(data_size);
float scale = 0.0f;
int zero_point = 0;
int32_t zero_point = 0;
ORT_RETURN_IF_ERROR(utils::GetQuantParams(static_cast<float>(rmin),
static_cast<float>(rmax),
info.qnn_data_type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Status ExpandOpBuilder::ProcessInputs(QnnModelWrapper& qnn_model_wrapper,
if (is_quantized_tensor) {
ORT_RETURN_IF_ERROR(utils::GetQnnDataType(true, type_proto, qnn_data_type));
float scale = 0.0f;
int zero_point = 0;
int32_t zero_point = 0;
float rmax = 1.0f;
float rmin = 1.0f;
ORT_RETURN_IF_ERROR(utils::GetQuantParams(rmin,
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/qnn/builder/qnn_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ double Dequantize(int32_t offset, float scale, const double quant_value) {

Status Quantize(const double double_value,
const float scale,
const int zero_point,
const int32_t zero_point,
const Qnn_DataType_t qnn_data_type,
int& quant_value) {
int qmin = 0;
Expand Down
4 changes: 2 additions & 2 deletions onnxruntime/core/providers/qnn/builder/qnn_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ Status GetQuantParams(float rmin,
float rmax,
const Qnn_DataType_t qnn_data_type,
float& scale,
int& zero_point,
int32_t& zero_point,
bool symmetric = false);

double Dequantize(int32_t offset, float scale, const double quant_value);

Status Quantize(const double double_value,
const float scale,
const int zero_point,
const int32_t zero_point,
const Qnn_DataType_t qnn_data_type,
int& quant_value);

Expand Down

0 comments on commit 67839ea

Please sign in to comment.