Skip to content

Commit

Permalink
fix(frontend-python): ensure shift strategies coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
rudy-6-4 committed Jan 5, 2024
1 parent 69efcee commit 2cf1508
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions frontends/concrete-python/tests/execution/test_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,18 @@
]
]

for _ in range(8):
NB_RANDOM_TESTS = 8

strategies = [
fhe.BitwiseStrategy.ONE_TLU_PROMOTED,
fhe.BitwiseStrategy.THREE_TLU_CASTED,
fhe.BitwiseStrategy.TWO_TLU_BIGGER_PROMOTED_SMALLER_CASTED,
fhe.BitwiseStrategy.TWO_TLU_BIGGER_CASTED_SMALLER_PROMOTED,
fhe.BitwiseStrategy.CHUNKED,
]
random_tests_stategies = strategies * (NB_RANDOM_TESTS // len(strategies) + 1)

for _ in range(NB_RANDOM_TESTS):
cases.append(
[
# operation
Expand All @@ -49,15 +60,7 @@
random.choice([(), (2,), (3, 2)]),
random.choice([(), (2,), (3, 2)]),
# strategy
random.choice(
[
fhe.BitwiseStrategy.ONE_TLU_PROMOTED,
fhe.BitwiseStrategy.THREE_TLU_CASTED,
fhe.BitwiseStrategy.TWO_TLU_BIGGER_PROMOTED_SMALLER_CASTED,
fhe.BitwiseStrategy.TWO_TLU_BIGGER_CASTED_SMALLER_PROMOTED,
fhe.BitwiseStrategy.CHUNKED,
]
),
random_tests_stategies.pop(),
]
)

Expand Down

0 comments on commit 2cf1508

Please sign in to comment.