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

Function test_modulus_sanity

tests/python/sealapi/test_modulus.py:73–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71
72
73def test_modulus_sanity():
74 custom_mod = sealapi.CoeffModulus.Create(1024, [32, 32])
75 assert len(custom_mod) == 2
76 for small_mod in custom_mod:
77 assert small_mod.is_prime() is True
78
79 small_mod = sealapi.PlainModulus.Batching(1024, 40)
80 assert small_mod.is_prime() is True
81 assert small_mod.bit_count() == 40
82
83 sizes = [16, 32, 40]
84 small_mods = sealapi.PlainModulus.Batching(1024, sizes)
85 for idx, small_mod in enumerate(small_mods):
86 assert small_mod.bit_count() == sizes[idx]
87
88
89@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

CreateMethod · 0.45

Tested by

no test coverage detected