File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
python/mlir/_mlir_libs/_mlir/dialects Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -250,6 +250,7 @@ static void populateDialectQuantSubmodule(const py::module &m) {
250
250
double scale = mlirUniformQuantizedPerAxisTypeGetScale (type, i);
251
251
scales.push_back (scale);
252
252
}
253
+ return scales;
253
254
},
254
255
" The scales designate the difference between the real values "
255
256
" corresponding to consecutive quantized values differing by 1. The ith "
@@ -265,6 +266,7 @@ static void populateDialectQuantSubmodule(const py::module &m) {
265
266
mlirUniformQuantizedPerAxisTypeGetZeroPoint (type, i);
266
267
zeroPoints.push_back (zeroPoint);
267
268
}
269
+ return zeroPoints;
268
270
},
269
271
" the storage values corresponding to the real value 0 in the affine "
270
272
" equation. The ith zero point corresponds to the ith slice in the "
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ class UniformQuantizedPerAxisType(QuantizedType):
101
101
def scales (self ) -> list [float ]: ...
102
102
103
103
@property
104
- def zero_points (self ) -> list [float ]: ...
104
+ def zero_points (self ) -> list [int ]: ...
105
105
106
106
@property
107
107
def quantized_dimension (self ) -> int : ...
Original file line number Diff line number Diff line change @@ -108,9 +108,9 @@ def test_uniform_per_axis_type():
108
108
),
109
109
)
110
110
111
- # CHECK: scales: None
111
+ # CHECK: scales: [200.0, 0.99872]
112
112
print (f"scales: { per_axis .scales } " )
113
- # CHECK: zero_points: None
113
+ # CHECK: zero_points: [0, 120]
114
114
print (f"zero_points: { per_axis .zero_points } " )
115
115
# CHECK: quantized dim: 1
116
116
print (f"quantized dim: { per_axis .quantized_dimension } " )
You can’t perform that action at this time.
0 commit comments