MCPcopy Create free account
hub / github.com/OpenMined/TenSEAL / test_batchencoder

Function test_batchencoder

tests/python/sealapi/test_encode_decode.py:10–19  ·  view source on GitHub ↗
(ctx)

Source from the content-addressed store, hash-verified

8
9@pytest.mark.parametrize("ctx", [helper_context_bfv(1024)])
10def test_batchencoder(ctx):
11 poly_modulus_degree = helper_poly_modulus_degree(ctx)
12 enc_out = sealapi.Plaintext()
13
14 testcase = [1, 2, 3, 4, 5]
15 encoder = sealapi.BatchEncoder(ctx)
16 encoder.encode(testcase, enc_out)
17 assert enc_out.dyn_array().size() == poly_modulus_degree
18 assert encoder.decode_uint64(enc_out)[: len(testcase)] == testcase
19 assert encoder.decode_int64(enc_out)[: len(testcase)] == testcase
20
21
22@pytest.mark.parametrize("testcase", [[10, 20, 30], [1 / div for div in range(2, 10)]])

Callers

nothing calls this directly

Calls 3

encodeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected