Skip to content

Commit

Permalink
more fixs around nnef q
Browse files Browse the repository at this point in the history
  • Loading branch information
kali committed Dec 12, 2023
1 parent 285f44e commit 27061a9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nnef/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl QuantFormat {
QuantFormat::Linear { params, bits, signed } => match (bits, signed) {
(8, true) => DatumType::QI8(*params),
(8, false) => DatumType::QU8(*params),
(32, true) => DatumType::I32,
(32, true) => DatumType::QI32(*params),
(32, false) => DatumType::U32,
_ => todo!(),
},
Expand Down
18 changes: 18 additions & 0 deletions test-rt/suite-unit/src/conv_q.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1183,5 +1183,23 @@ pub fn suite() -> TractResult<TestSuite> {
raw_output_dt: DatumType::I32,
},
);
let mut qp = qp_noop_i8();
qp[1] = tensor0(0.25f32);
qp[2] = tensor0(1i32);
qp[5] = tensor0(0.5f32);
suite.add(
"i32_output_1",
QConvProblem {
shape_in: CHW.from_n_c_hw(1, 1, [1]).unwrap(),
co: 1,
kernel_format: OIHW,
group: 1,
kernel: tensor3(&[[[20i8]]]),
bias: None,
data: tensor2(&[[94i8]]),
qp,
raw_output_dt: DatumType::I32,
},
);
Ok(suite)
}

0 comments on commit 27061a9

Please sign in to comment.