Commit 31bdc2e9 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

implement tests for parallel extractor training too

parent ac1c9afc
Pipeline #13797 passed with stages
in 11 minutes and 27 seconds
......@@ -47,7 +47,7 @@ def test_extractors():
assert all(np.allclose(x1, x2) for x1, x2 in zip(data, PAR_DATA))
def test_trainable_extractors():
def test_sequential_trainable_extractors():
processors = [CallableExtractor(p) for p in PROCESSORS] + [dummy_extractor]
proc = SequentialExtractor(processors)
with tempfile.NamedTemporaryFile(suffix='.hdf5') as f:
......@@ -55,3 +55,13 @@ def test_trainable_extractors():
proc.load(f.name)
data = proc(DATA)
assert np.allclose(data, SEQ_DATA)
def test_parallel_trainable_extractors():
processors = [CallableExtractor(p) for p in PROCESSORS] + [dummy_extractor]
proc = ParallelExtractor(processors)
with tempfile.NamedTemporaryFile(suffix='.hdf5') as f:
proc.train(DATA, f.name)
proc.load(f.name)
data = proc(np.array(DATA))
assert all(np.allclose(x1, x2) for x1, x2 in zip(data, PAR_DATA))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment