mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-08 19:44:57 -05:00
The current scheme with in-place updates of the types of values may result in operations recognized as legal and thus preventing them from being converted when the operations producing their operands have been converted earlier, as their types have been updated and legality is solely based on types. For example, the conversion pattern for an `tensor.insert_slice` operation working on tensors of encrypted values may not trigger if the operations producing its operands have been converted, leaving the operation with updated operand types with the extra dimension added by the type conversion from TFHE to Concrete, but with unmodified sizes, strides and offsets, not taking into account the extra dimension. This causes the verifier of the affected operation to fail and the compilation to abort. By using op conversion patterns, the original types of each operation are preserved during the actual rewrite, correctly triggering all conversion patterns based on the legality of data types.