Skip to content

Commit

Permalink
add unittests for multithread buffer
Browse files Browse the repository at this point in the history
Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
  • Loading branch information
bhashemian committed Jul 10, 2023
1 parent 2b9ec31 commit a40b29a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_patch_inferer.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
TENSOR_4x4,
]


# non-divisible patch_size leading to larger image (without matching spatial shape)
TEST_CASE_11_PADDING = [
TENSOR_4x4,
Expand Down Expand Up @@ -155,6 +156,23 @@
TENSOR_4x4,
]

# multi-threading
TEST_CASE_14_MULTITHREAD_BUFFER = [
TENSOR_4x4,
dict(splitter=SlidingWindowSplitter(patch_size=(2, 2)), merger_cls=AvgMerger, buffer_size=2),
lambda x: x,
TENSOR_4x4,
]

# multi-threading with batch
TEST_CASE_15_MULTITHREADD_BUFFER = [
TENSOR_4x4,
dict(splitter=SlidingWindowSplitter(patch_size=(2, 2)), merger_cls=AvgMerger, buffer_size=4, batch_size=4),
lambda x: x,
TENSOR_4x4,
]


# list of tensor output
TEST_CASE_0_LIST_TENSOR = [
TENSOR_4x4,
Expand Down Expand Up @@ -245,6 +263,8 @@ class PatchInfererTests(unittest.TestCase):
TEST_CASE_11_PADDING,
TEST_CASE_12_MATCHING,
TEST_CASE_13_PADDING_MATCHING,
TEST_CASE_14_MULTITHREAD_BUFFER,
TEST_CASE_15_MULTITHREADD_BUFFER,
]
)
def test_patch_inferer_tensor(self, inputs, arguments, network, expected):
Expand Down

0 comments on commit a40b29a

Please sign in to comment.