From: Jihoon Lee Date: Wed, 6 Oct 2021 03:17:28 +0000 (+0900) Subject: [Dataset/test] Update batch before creating tensor X-Git-Tag: accepted/tizen/unified/20220323.062643~377 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e944caadd69de4c55f49f572c762550047177adb;p=platform%2Fcore%2Fml%2Fnntrainer.git [Dataset/test] Update batch before creating tensor Dataset sample creating now creates a tensor after updating batch to one **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped resolves #1604 Signed-off-by: Jihoon Lee --- diff --git a/test/unittest/datasets/data_producer_common_tests.cpp b/test/unittest/datasets/data_producer_common_tests.cpp index 40a797d..b9617da 100644 --- a/test/unittest/datasets/data_producer_common_tests.cpp +++ b/test/unittest/datasets/data_producer_common_tests.cpp @@ -22,9 +22,9 @@ static std::tuple /** inputs */, createSample(const std::vector &input_dims, const std::vector &label_dims) { using namespace nntrainer; - auto populate_tensor = [](const TensorDim &dim) { + auto populate_tensor = [](TensorDim dim) { + dim.batch(1); Tensor t(dim); - t.updateBatch(1); return t; }; @@ -68,7 +68,7 @@ TEST_P(DataProducerSemantics, finalize_pn) { } } -TEST_P(DataProducerSemantics, DISABLED_error_once_or_not_pn) { +TEST_P(DataProducerSemantics, error_once_or_not_pn) { if (result == DataProducerSemanticsExpectedResult::FAIL_AT_FINALIZE) { return; // skip this test } @@ -85,7 +85,7 @@ TEST_P(DataProducerSemantics, DISABLED_error_once_or_not_pn) { } } -TEST_P(DataProducerSemantics, DISABLED_fetch_one_epoch_or_10_iteration_pn) { +TEST_P(DataProducerSemantics, fetch_one_epoch_or_10_iteration_pn) { if (result != DataProducerSemanticsExpectedResult::SUCCESS) { return; // skip this test }