mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-19 08:54:26 -05:00
fix: Do not assert fail with too large weight and fix computation of 2-Norm with negative weigth (close #892)
This commit is contained in:
@@ -183,6 +183,17 @@ func.func @single_cst_mul_eint_int_neg(%e: !FHE.eint<2>) -> !FHE.eint<2>
|
||||
return %0 : !FHE.eint<2>
|
||||
}
|
||||
|
||||
// -----
|
||||
|
||||
func.func @single_cst_mul_eint_int_neg(%e: !FHE.eint<2>) -> !FHE.eint<2>
|
||||
{
|
||||
%cst = arith.constant -1 : i3
|
||||
|
||||
// %0 = "FHE.mul_eint_int"(%[[op0:.*]], %[[op1:.*]]) {MANP = 1 : ui{{[0-9]+}}} : (!FHE.eint<2>, i3) -> !FHE.eint<2>
|
||||
%0 = "FHE.mul_eint_int"(%e, %cst) : (!FHE.eint<2>, i3) -> !FHE.eint<2>
|
||||
|
||||
return %0 : !FHE.eint<2>
|
||||
}
|
||||
|
||||
// -----
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ func.func @single_cst_dot_after_op(%t: tensor<4x!FHE.eint<2>>, %i: tensor<4xi3>)
|
||||
|
||||
%cst = arith.constant dense<[1, 2, 3, -1]> : tensor<4xi3>
|
||||
// sqrt(1^2*9 + 2^2*9 + 3^2*9 + 1^2*9) = sqrt(135) = 12
|
||||
// CHECK: %[[V1:.*]] = "FHELinalg.dot_eint_int"(%[[V0]], %[[CST:.*]]) {MANP = 56 : ui{{[[0-9]+}}}
|
||||
// CHECK: %[[V1:.*]] = "FHELinalg.dot_eint_int"(%[[V0]], %[[CST:.*]]) {MANP = 28 : ui{{[[0-9]+}}}
|
||||
%1 = "FHELinalg.dot_eint_int"(%0, %cst) : (tensor<4x!FHE.eint<2>>, tensor<4xi3>) -> !FHE.eint<2>
|
||||
|
||||
return %1 : !FHE.eint<2>
|
||||
|
||||
Reference in New Issue
Block a user