Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Commit 228c8d6

Browse files
annuasd牛奕博
andauthored
[mlir][Bindings] Fix missing return value of functions and incorrect type hint in pyi. (#116731)
The zero points of UniformQuantizedPerAxisType should be List[int]. And there are two methods missing return value. Co-authored-by: 牛奕博 <[email protected]>
1 parent 7c44357 commit 228c8d6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

mlir/lib/Bindings/Python/DialectQuant.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ static void populateDialectQuantSubmodule(const py::module &m) {
250250
double scale = mlirUniformQuantizedPerAxisTypeGetScale(type, i);
251251
scales.push_back(scale);
252252
}
253+
return scales;
253254
},
254255
"The scales designate the difference between the real values "
255256
"corresponding to consecutive quantized values differing by 1. The ith "
@@ -265,6 +266,7 @@ static void populateDialectQuantSubmodule(const py::module &m) {
265266
mlirUniformQuantizedPerAxisTypeGetZeroPoint(type, i);
266267
zeroPoints.push_back(zeroPoint);
267268
}
269+
return zeroPoints;
268270
},
269271
"the storage values corresponding to the real value 0 in the affine "
270272
"equation. The ith zero point corresponds to the ith slice in the "

mlir/python/mlir/_mlir_libs/_mlir/dialects/quant.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class UniformQuantizedPerAxisType(QuantizedType):
101101
def scales(self) -> list[float]: ...
102102

103103
@property
104-
def zero_points(self) -> list[float]: ...
104+
def zero_points(self) -> list[int]: ...
105105

106106
@property
107107
def quantized_dimension(self) -> int: ...

0 commit comments

Comments
 (0)