Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A fatal BUG #500

Open
zibinpan opened this issue Oct 27, 2024 · 1 comment
Open

A fatal BUG #500

zibinpan opened this issue Oct 27, 2024 · 1 comment
Labels
Type: Bug 🐛 Some functionality not working in the codebase as intended

Comments

@zibinpan
Copy link

When the size of the matrix A is a little large, for example, 192 * 784. It fails when calculating the multiplication of the encrypted A and a plaintext vector B, rasing the error: ValueError: can't execute enc_matmul_plain on chunked vectors

code:

import numpy as np
import tenseal as ts


context = ts.context(
            ts.SCHEME_TYPE.CKKS,
            poly_modulus_degree=2**15,
            coeff_mod_bit_sizes=[50,40,40,40,40,40,50]
          )
context.global_scale = 2**40
context.generate_galois_keys()

v1 = np.random.rand(784).tolist()

matrix = np.random.rand(192, 784).tolist()

enc_matrix = ts.enc_matmul_encoding(context, matrix)
result = enc_matrix.enc_matmul_plain(v1, len(matrix))

print(result.decrypt())

@zibinpan zibinpan added the Type: Bug 🐛 Some functionality not working in the codebase as intended label Oct 27, 2024
@zibinpan
Copy link
Author

zibinpan commented Oct 27, 2024

If I change the size of the matrix to 12 * 784, the code can run successfully. But I need it to be 192 * 784.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 Some functionality not working in the codebase as intended
Projects
None yet
Development

No branches or pull requests

1 participant