mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-08 11:35:02 -05:00
fix(compiler): fix plaintext tensor shape when using crt
client parameter generation was removing last dimension of a tensor when using CRT including plaintext ones, while it should only be done for encrypted ones.
This commit is contained in:
committed by
Ayoub Benaissa
parent
b6da228dd4
commit
3bdebae1f6
@@ -210,9 +210,10 @@ generateGate(mlir::Type type, encodings::Encoding encoding,
|
||||
if (auto err = scalarGate.takeError()) {
|
||||
return std::move(err);
|
||||
}
|
||||
if (maybeCrt.has_value()) {
|
||||
// When using crt, the last dimension of the tensor is for the members
|
||||
// of the decomposition. It should not be used.
|
||||
if (maybeCrt.has_value() && scalarGate->isEncrypted()) {
|
||||
// When using crt with encrypted tensors, the last dimension of the
|
||||
// tensor is for the members of the decomposition. It should not be
|
||||
// used.
|
||||
scalarGate->shape.dimensions =
|
||||
tensor.getShape().take_front(tensor.getShape().size() - 1).vec();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user