mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 20:25:34 -05:00
feat(compiler): Add HLFHELinalg.zero operation
Add a new operation `HLFHELinalg.zero`, broadcasting an encrypted, zero-valued integer into a tensor of encrypted integers with static shape. Example creating a one-dimensional tensor with five elements all initialized to an encrypted zero: %tensor = "HLFHELinalg.zero"() : () -> tensor<5x!HLFHE.eint<4>>
This commit is contained in:
@@ -444,5 +444,21 @@ def MatMulIntEintOp : HLFHELinalg_Op<"matmul_int_eint", [TensorBinaryIntEint]> {
|
||||
}];
|
||||
}
|
||||
|
||||
def ZeroOp : HLFHELinalg_Op<"zero", []> {
|
||||
let summary = "Creates a new tensor with all elements initialized to an encrypted zero.";
|
||||
|
||||
let description = [{
|
||||
Creates a new tensor with the shape specified in the result type and initializes its elements with an encrypted zero.
|
||||
|
||||
Example:
|
||||
```mlir
|
||||
%tensor = "HLFHELinalg.zero"() : () -> tensor<5x!HLFHE.eint<4>>
|
||||
```
|
||||
}];
|
||||
|
||||
let arguments = (ins);
|
||||
|
||||
let results = (outs Type<And<[TensorOf<[EncryptedIntegerType]>.predicate, HasStaticShapePred]>>:$aggregate);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user