You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_sampler_chain.py 17 kB

added python api based on cpp api 1st draft of python iterator Added Cifar10 and Cifar100 pybind port Change pybind to use IR for Skip and Manifest Signed-off-by: alex-yuyue <yue.yu1@huawei.com> DatasetNode as a base for all IR nodes namespace change Fix the namespace issue and make ut tests work Signed-off-by: alex-yuyue <yue.yu1@huawei.com> Add VOCDataset !63 Added RandomDataset * Added RandomDataset add imagefolder ir Pybind switch: CelebA and UT !61 CLUE example with class definition * Merge branch 'python-api' of gitee.com:ezphlow/mindspore into clue_class_pybind * Passing testcases * Added CLUE, not working add ManifestDataset IR Signed-off-by: alex-yuyue <yue.yu1@huawei.com> Update Coco & VOC & TFReader, Update clang-format, Reorder datasets_binding !69 Add Generator and move c_dataset.Iterator to dataset.Iterator * Add GeneratorDataset to c_dataset * Add GeneratorDataset to c_dataset !67 Moving c_datasets and adding sampler wrapper * Need to add create() method in datasets.py * migration from c_dataset to dataset part 1 !71 Fix indent error * Fix indentation error !72 Fix c_api tests cases * Fix c_api tests cases !73 Added CSV Dataset * Added CSVDataset pybind switch: Take and CelebA fixes !75 move c_dataset functionality to datasets * Fixed existing testcases * Added working clue and imagefolder * Added sampler conversion from pybind * Added sampler creation !77 Add Python API tree * Python API tree add minddataset TextFileDataset pybind Rename to skip test_concat.py and test_minddataset_exception.py !80 Add batch IR to python-api branch, most test cases work * staging III * staging, add pybind Enable more c_api take and CelebA tests; delete util_c_api !84 Schema changes in datasets.py * Schema changes !85 Remove input_indexes from sub-classes * remove input_index from each subclass !83 Remove C datasets * Removed c_dataset package * Remove c_datasets !82 pybind switch: shuffle * pybind switch: shuffle !86 Add build_vocab * Add build_vocab Rebase with upstream/master _shuffle conflict BatchNode error !88 Fix rebase problem * fix rebase problem Enable more unit tests; code typo/nit fixes !91 Fix python vocag hang * Fix python vocab hang !89 Added BucketBatchByLength Pybind switch * Added BucketBatchByLength Update and enable more tet_c_api_*.py tests !95 Add BuildSentencePeiceVocab * - Add BuildSentencePeiceVocab !96 Fix more tests * - Fix some tests - Enable more test_c_api_* - Add syncwait !99 pybind switch for device op * pybind switch for device op !93 Add getters to python API * Add getters to python API !101 Validate tree, error if graph * - Add sync wait !103 TFrecord/Random Datasets schema problem * - TfRecord/Random schem aproblem !102 Added filter pybind switch * Added Filter pybind switch !104 Fix num_samples * - TfRecord/Random schem aproblem !105 Fix to_device hang * Fix to_device hang !94 Adds Cache support for CLUE dataset * Added cache for all dataset ops * format change * Added CLUE cache support * Added Cache conversion Add save pybind fix compile err init modify concat_node !107 Fix some tests cases * Fix tests cases Enable and fix more tests !109 pybind switch for get dataset size * pybind_get_dataset_size some check-code fixes for pylint, cpplint and clang-format !113 Add callback * revert * dataset_sz 1 line * fix typo * get callback to work !114 Make Android compile clean * Make Android Compile Clean Fix build issues due to rebase !115 Fix more tests * Fix tests cases * !93 Add getters to python API fix test_profiling.py !116 fix get dataset size * fix get dataset size !117 GetColumnNames pybind switch * Added GetColumnNames pybind switch code-check fixes: clangformat, cppcheck, cpplint, pylint Delete duplicate test_c_api_*.py files; more lint fixes !121 Fix cpp tests * Remove extra call to getNext in cpp tests !122 Fix Schema with Generator * Fix Schema with Generator fix some cases of csv & mindrecord !124 fix tfrecord get_dataset_size and add some UTs * fix tfrecord get dataset size and add some ut for get_dataset_size !125 getter separation * Getter separation !126 Fix sampler.GetNumSamples * Fix sampler.GetNumSampler !127 Assign runtime getter to each get function * Assign runtime getter to each get function Fix compile issues !128 Match master code * Match master code !129 Cleanup DeviceOp/save code * Cleanup ToDevice/Save code !130 Add cache fix * Added cache fix for map and image folder !132 Fix testing team issues * Pass queue_name from python to C++ * Add Schema.from_json !131 Fix Cache op issues and delete de_pipeline * Roll back C++ change * Removed de_pipeline and passing all cache tests. * fixed cache tests !134 Cleanup datasets.py part1 * Cleanup dataset.py part1 !133 Updated validation for SentencePieceVocab.from_dataset * Added type_check for column names in SentencePieceVocab.from_dataset Rebase on master 181120 10:20 fix profiling temporary solution of catching stauts from Node.Build() !141 ToDevice Termination * ToDevice termination pylint fixes !137 Fix test team issues and add some corresponding tests * Fix test team issues and add some corresponding tests !138 TreeGetter changes to use OptPass * Getter changes to use OptPass (Zirui) Rebase fix !143 Fix cpplint issue * Fix cpplint issue pylint fixes in updated testcases !145 Reset exceptions testcase * reset exception test to master !146 Fix Check_Pylint Error * Fix Check_Pylint Error !147 fix android * fix android !148 ToDevice changes * Add ToDevice to the iterator List for cleanup at exit !149 Pylint issue * Add ToDevice to the iterator List for cleanup at exit !150 Pylint 2 * Add ToDevice to the iterator List for cleanup at exit !152 ExecutionTree error * ET destructor error !153 in getter_pass, only remove callback, without deleting map op * getter pass no longer removes map !156 early __del__ of iterator/to_device * early __del__ of iterator !155 Address review comments Eric 1 * Added one liner fix to validators.py * roll back signature fix * lint fix * Eric Address comments 2 * C++ lint fix * Address comments Eric 1 !158 Review rework for dataset bindings - part 1 * Reorder nodes repeat and rename * Review rework for dataset bindings - part 1 !154 Fixing minor problems in the comments (datasets.py, python_tree_consumer.cc, iterators_bindings.cc, and iterators.py) * Fixing minor problems in the comments (datasets.py, python_tree_consum… !157 add replace none * Add replace_none to datasets.py, address comments in tests Trying to resolve copy Override the deepcopy method of deviceop Create_ir_tree method Create_ir_tree method 2 Create_ir_tree method 2 del to_device if already exists del to_device if already exists cache getters shapes and types Added yolov3 relaxation, to be rolled back Get shapes and types together bypass yolo NumWorkers for MapOp revert Yolo revert Thor Print more info Debug code: Update LOG INFO to LOG ERROR do not remove epochctrl for getter pass Remove repeat(1) pritn batch size add log to tree_consumer and device_queue op Revert PR 8744 Signed-off-by: alex-yuyue <yue.yu1@huawei.com> __del__ toDEvice __del__ toDevice2 !165 add ifndef ENABLE_ANDROID to device queue print * Add ifndef ENABLE_ANDROID to device queue print revert some changes !166 getter: get_data_info * getter: get_data_info !168 add back tree print * revert info to warnning in one log * add back the missed print tree log Release GIL in GetDataInfo
5 years ago
added python api based on cpp api 1st draft of python iterator Added Cifar10 and Cifar100 pybind port Change pybind to use IR for Skip and Manifest Signed-off-by: alex-yuyue <yue.yu1@huawei.com> DatasetNode as a base for all IR nodes namespace change Fix the namespace issue and make ut tests work Signed-off-by: alex-yuyue <yue.yu1@huawei.com> Add VOCDataset !63 Added RandomDataset * Added RandomDataset add imagefolder ir Pybind switch: CelebA and UT !61 CLUE example with class definition * Merge branch 'python-api' of gitee.com:ezphlow/mindspore into clue_class_pybind * Passing testcases * Added CLUE, not working add ManifestDataset IR Signed-off-by: alex-yuyue <yue.yu1@huawei.com> Update Coco & VOC & TFReader, Update clang-format, Reorder datasets_binding !69 Add Generator and move c_dataset.Iterator to dataset.Iterator * Add GeneratorDataset to c_dataset * Add GeneratorDataset to c_dataset !67 Moving c_datasets and adding sampler wrapper * Need to add create() method in datasets.py * migration from c_dataset to dataset part 1 !71 Fix indent error * Fix indentation error !72 Fix c_api tests cases * Fix c_api tests cases !73 Added CSV Dataset * Added CSVDataset pybind switch: Take and CelebA fixes !75 move c_dataset functionality to datasets * Fixed existing testcases * Added working clue and imagefolder * Added sampler conversion from pybind * Added sampler creation !77 Add Python API tree * Python API tree add minddataset TextFileDataset pybind Rename to skip test_concat.py and test_minddataset_exception.py !80 Add batch IR to python-api branch, most test cases work * staging III * staging, add pybind Enable more c_api take and CelebA tests; delete util_c_api !84 Schema changes in datasets.py * Schema changes !85 Remove input_indexes from sub-classes * remove input_index from each subclass !83 Remove C datasets * Removed c_dataset package * Remove c_datasets !82 pybind switch: shuffle * pybind switch: shuffle !86 Add build_vocab * Add build_vocab Rebase with upstream/master _shuffle conflict BatchNode error !88 Fix rebase problem * fix rebase problem Enable more unit tests; code typo/nit fixes !91 Fix python vocag hang * Fix python vocab hang !89 Added BucketBatchByLength Pybind switch * Added BucketBatchByLength Update and enable more tet_c_api_*.py tests !95 Add BuildSentencePeiceVocab * - Add BuildSentencePeiceVocab !96 Fix more tests * - Fix some tests - Enable more test_c_api_* - Add syncwait !99 pybind switch for device op * pybind switch for device op !93 Add getters to python API * Add getters to python API !101 Validate tree, error if graph * - Add sync wait !103 TFrecord/Random Datasets schema problem * - TfRecord/Random schem aproblem !102 Added filter pybind switch * Added Filter pybind switch !104 Fix num_samples * - TfRecord/Random schem aproblem !105 Fix to_device hang * Fix to_device hang !94 Adds Cache support for CLUE dataset * Added cache for all dataset ops * format change * Added CLUE cache support * Added Cache conversion Add save pybind fix compile err init modify concat_node !107 Fix some tests cases * Fix tests cases Enable and fix more tests !109 pybind switch for get dataset size * pybind_get_dataset_size some check-code fixes for pylint, cpplint and clang-format !113 Add callback * revert * dataset_sz 1 line * fix typo * get callback to work !114 Make Android compile clean * Make Android Compile Clean Fix build issues due to rebase !115 Fix more tests * Fix tests cases * !93 Add getters to python API fix test_profiling.py !116 fix get dataset size * fix get dataset size !117 GetColumnNames pybind switch * Added GetColumnNames pybind switch code-check fixes: clangformat, cppcheck, cpplint, pylint Delete duplicate test_c_api_*.py files; more lint fixes !121 Fix cpp tests * Remove extra call to getNext in cpp tests !122 Fix Schema with Generator * Fix Schema with Generator fix some cases of csv & mindrecord !124 fix tfrecord get_dataset_size and add some UTs * fix tfrecord get dataset size and add some ut for get_dataset_size !125 getter separation * Getter separation !126 Fix sampler.GetNumSamples * Fix sampler.GetNumSampler !127 Assign runtime getter to each get function * Assign runtime getter to each get function Fix compile issues !128 Match master code * Match master code !129 Cleanup DeviceOp/save code * Cleanup ToDevice/Save code !130 Add cache fix * Added cache fix for map and image folder !132 Fix testing team issues * Pass queue_name from python to C++ * Add Schema.from_json !131 Fix Cache op issues and delete de_pipeline * Roll back C++ change * Removed de_pipeline and passing all cache tests. * fixed cache tests !134 Cleanup datasets.py part1 * Cleanup dataset.py part1 !133 Updated validation for SentencePieceVocab.from_dataset * Added type_check for column names in SentencePieceVocab.from_dataset Rebase on master 181120 10:20 fix profiling temporary solution of catching stauts from Node.Build() !141 ToDevice Termination * ToDevice termination pylint fixes !137 Fix test team issues and add some corresponding tests * Fix test team issues and add some corresponding tests !138 TreeGetter changes to use OptPass * Getter changes to use OptPass (Zirui) Rebase fix !143 Fix cpplint issue * Fix cpplint issue pylint fixes in updated testcases !145 Reset exceptions testcase * reset exception test to master !146 Fix Check_Pylint Error * Fix Check_Pylint Error !147 fix android * fix android !148 ToDevice changes * Add ToDevice to the iterator List for cleanup at exit !149 Pylint issue * Add ToDevice to the iterator List for cleanup at exit !150 Pylint 2 * Add ToDevice to the iterator List for cleanup at exit !152 ExecutionTree error * ET destructor error !153 in getter_pass, only remove callback, without deleting map op * getter pass no longer removes map !156 early __del__ of iterator/to_device * early __del__ of iterator !155 Address review comments Eric 1 * Added one liner fix to validators.py * roll back signature fix * lint fix * Eric Address comments 2 * C++ lint fix * Address comments Eric 1 !158 Review rework for dataset bindings - part 1 * Reorder nodes repeat and rename * Review rework for dataset bindings - part 1 !154 Fixing minor problems in the comments (datasets.py, python_tree_consumer.cc, iterators_bindings.cc, and iterators.py) * Fixing minor problems in the comments (datasets.py, python_tree_consum… !157 add replace none * Add replace_none to datasets.py, address comments in tests Trying to resolve copy Override the deepcopy method of deviceop Create_ir_tree method Create_ir_tree method 2 Create_ir_tree method 2 del to_device if already exists del to_device if already exists cache getters shapes and types Added yolov3 relaxation, to be rolled back Get shapes and types together bypass yolo NumWorkers for MapOp revert Yolo revert Thor Print more info Debug code: Update LOG INFO to LOG ERROR do not remove epochctrl for getter pass Remove repeat(1) pritn batch size add log to tree_consumer and device_queue op Revert PR 8744 Signed-off-by: alex-yuyue <yue.yu1@huawei.com> __del__ toDEvice __del__ toDevice2 !165 add ifndef ENABLE_ANDROID to device queue print * Add ifndef ENABLE_ANDROID to device queue print revert some changes !166 getter: get_data_info * getter: get_data_info !168 add back tree print * revert info to warnning in one log * add back the missed print tree log Release GIL in GetDataInfo
5 years ago
added python api based on cpp api 1st draft of python iterator Added Cifar10 and Cifar100 pybind port Change pybind to use IR for Skip and Manifest Signed-off-by: alex-yuyue <yue.yu1@huawei.com> DatasetNode as a base for all IR nodes namespace change Fix the namespace issue and make ut tests work Signed-off-by: alex-yuyue <yue.yu1@huawei.com> Add VOCDataset !63 Added RandomDataset * Added RandomDataset add imagefolder ir Pybind switch: CelebA and UT !61 CLUE example with class definition * Merge branch 'python-api' of gitee.com:ezphlow/mindspore into clue_class_pybind * Passing testcases * Added CLUE, not working add ManifestDataset IR Signed-off-by: alex-yuyue <yue.yu1@huawei.com> Update Coco & VOC & TFReader, Update clang-format, Reorder datasets_binding !69 Add Generator and move c_dataset.Iterator to dataset.Iterator * Add GeneratorDataset to c_dataset * Add GeneratorDataset to c_dataset !67 Moving c_datasets and adding sampler wrapper * Need to add create() method in datasets.py * migration from c_dataset to dataset part 1 !71 Fix indent error * Fix indentation error !72 Fix c_api tests cases * Fix c_api tests cases !73 Added CSV Dataset * Added CSVDataset pybind switch: Take and CelebA fixes !75 move c_dataset functionality to datasets * Fixed existing testcases * Added working clue and imagefolder * Added sampler conversion from pybind * Added sampler creation !77 Add Python API tree * Python API tree add minddataset TextFileDataset pybind Rename to skip test_concat.py and test_minddataset_exception.py !80 Add batch IR to python-api branch, most test cases work * staging III * staging, add pybind Enable more c_api take and CelebA tests; delete util_c_api !84 Schema changes in datasets.py * Schema changes !85 Remove input_indexes from sub-classes * remove input_index from each subclass !83 Remove C datasets * Removed c_dataset package * Remove c_datasets !82 pybind switch: shuffle * pybind switch: shuffle !86 Add build_vocab * Add build_vocab Rebase with upstream/master _shuffle conflict BatchNode error !88 Fix rebase problem * fix rebase problem Enable more unit tests; code typo/nit fixes !91 Fix python vocag hang * Fix python vocab hang !89 Added BucketBatchByLength Pybind switch * Added BucketBatchByLength Update and enable more tet_c_api_*.py tests !95 Add BuildSentencePeiceVocab * - Add BuildSentencePeiceVocab !96 Fix more tests * - Fix some tests - Enable more test_c_api_* - Add syncwait !99 pybind switch for device op * pybind switch for device op !93 Add getters to python API * Add getters to python API !101 Validate tree, error if graph * - Add sync wait !103 TFrecord/Random Datasets schema problem * - TfRecord/Random schem aproblem !102 Added filter pybind switch * Added Filter pybind switch !104 Fix num_samples * - TfRecord/Random schem aproblem !105 Fix to_device hang * Fix to_device hang !94 Adds Cache support for CLUE dataset * Added cache for all dataset ops * format change * Added CLUE cache support * Added Cache conversion Add save pybind fix compile err init modify concat_node !107 Fix some tests cases * Fix tests cases Enable and fix more tests !109 pybind switch for get dataset size * pybind_get_dataset_size some check-code fixes for pylint, cpplint and clang-format !113 Add callback * revert * dataset_sz 1 line * fix typo * get callback to work !114 Make Android compile clean * Make Android Compile Clean Fix build issues due to rebase !115 Fix more tests * Fix tests cases * !93 Add getters to python API fix test_profiling.py !116 fix get dataset size * fix get dataset size !117 GetColumnNames pybind switch * Added GetColumnNames pybind switch code-check fixes: clangformat, cppcheck, cpplint, pylint Delete duplicate test_c_api_*.py files; more lint fixes !121 Fix cpp tests * Remove extra call to getNext in cpp tests !122 Fix Schema with Generator * Fix Schema with Generator fix some cases of csv & mindrecord !124 fix tfrecord get_dataset_size and add some UTs * fix tfrecord get dataset size and add some ut for get_dataset_size !125 getter separation * Getter separation !126 Fix sampler.GetNumSamples * Fix sampler.GetNumSampler !127 Assign runtime getter to each get function * Assign runtime getter to each get function Fix compile issues !128 Match master code * Match master code !129 Cleanup DeviceOp/save code * Cleanup ToDevice/Save code !130 Add cache fix * Added cache fix for map and image folder !132 Fix testing team issues * Pass queue_name from python to C++ * Add Schema.from_json !131 Fix Cache op issues and delete de_pipeline * Roll back C++ change * Removed de_pipeline and passing all cache tests. * fixed cache tests !134 Cleanup datasets.py part1 * Cleanup dataset.py part1 !133 Updated validation for SentencePieceVocab.from_dataset * Added type_check for column names in SentencePieceVocab.from_dataset Rebase on master 181120 10:20 fix profiling temporary solution of catching stauts from Node.Build() !141 ToDevice Termination * ToDevice termination pylint fixes !137 Fix test team issues and add some corresponding tests * Fix test team issues and add some corresponding tests !138 TreeGetter changes to use OptPass * Getter changes to use OptPass (Zirui) Rebase fix !143 Fix cpplint issue * Fix cpplint issue pylint fixes in updated testcases !145 Reset exceptions testcase * reset exception test to master !146 Fix Check_Pylint Error * Fix Check_Pylint Error !147 fix android * fix android !148 ToDevice changes * Add ToDevice to the iterator List for cleanup at exit !149 Pylint issue * Add ToDevice to the iterator List for cleanup at exit !150 Pylint 2 * Add ToDevice to the iterator List for cleanup at exit !152 ExecutionTree error * ET destructor error !153 in getter_pass, only remove callback, without deleting map op * getter pass no longer removes map !156 early __del__ of iterator/to_device * early __del__ of iterator !155 Address review comments Eric 1 * Added one liner fix to validators.py * roll back signature fix * lint fix * Eric Address comments 2 * C++ lint fix * Address comments Eric 1 !158 Review rework for dataset bindings - part 1 * Reorder nodes repeat and rename * Review rework for dataset bindings - part 1 !154 Fixing minor problems in the comments (datasets.py, python_tree_consumer.cc, iterators_bindings.cc, and iterators.py) * Fixing minor problems in the comments (datasets.py, python_tree_consum… !157 add replace none * Add replace_none to datasets.py, address comments in tests Trying to resolve copy Override the deepcopy method of deviceop Create_ir_tree method Create_ir_tree method 2 Create_ir_tree method 2 del to_device if already exists del to_device if already exists cache getters shapes and types Added yolov3 relaxation, to be rolled back Get shapes and types together bypass yolo NumWorkers for MapOp revert Yolo revert Thor Print more info Debug code: Update LOG INFO to LOG ERROR do not remove epochctrl for getter pass Remove repeat(1) pritn batch size add log to tree_consumer and device_queue op Revert PR 8744 Signed-off-by: alex-yuyue <yue.yu1@huawei.com> __del__ toDEvice __del__ toDevice2 !165 add ifndef ENABLE_ANDROID to device queue print * Add ifndef ENABLE_ANDROID to device queue print revert some changes !166 getter: get_data_info * getter: get_data_info !168 add back tree print * revert info to warnning in one log * add back the missed print tree log Release GIL in GetDataInfo
5 years ago
added python api based on cpp api 1st draft of python iterator Added Cifar10 and Cifar100 pybind port Change pybind to use IR for Skip and Manifest Signed-off-by: alex-yuyue <yue.yu1@huawei.com> DatasetNode as a base for all IR nodes namespace change Fix the namespace issue and make ut tests work Signed-off-by: alex-yuyue <yue.yu1@huawei.com> Add VOCDataset !63 Added RandomDataset * Added RandomDataset add imagefolder ir Pybind switch: CelebA and UT !61 CLUE example with class definition * Merge branch 'python-api' of gitee.com:ezphlow/mindspore into clue_class_pybind * Passing testcases * Added CLUE, not working add ManifestDataset IR Signed-off-by: alex-yuyue <yue.yu1@huawei.com> Update Coco & VOC & TFReader, Update clang-format, Reorder datasets_binding !69 Add Generator and move c_dataset.Iterator to dataset.Iterator * Add GeneratorDataset to c_dataset * Add GeneratorDataset to c_dataset !67 Moving c_datasets and adding sampler wrapper * Need to add create() method in datasets.py * migration from c_dataset to dataset part 1 !71 Fix indent error * Fix indentation error !72 Fix c_api tests cases * Fix c_api tests cases !73 Added CSV Dataset * Added CSVDataset pybind switch: Take and CelebA fixes !75 move c_dataset functionality to datasets * Fixed existing testcases * Added working clue and imagefolder * Added sampler conversion from pybind * Added sampler creation !77 Add Python API tree * Python API tree add minddataset TextFileDataset pybind Rename to skip test_concat.py and test_minddataset_exception.py !80 Add batch IR to python-api branch, most test cases work * staging III * staging, add pybind Enable more c_api take and CelebA tests; delete util_c_api !84 Schema changes in datasets.py * Schema changes !85 Remove input_indexes from sub-classes * remove input_index from each subclass !83 Remove C datasets * Removed c_dataset package * Remove c_datasets !82 pybind switch: shuffle * pybind switch: shuffle !86 Add build_vocab * Add build_vocab Rebase with upstream/master _shuffle conflict BatchNode error !88 Fix rebase problem * fix rebase problem Enable more unit tests; code typo/nit fixes !91 Fix python vocag hang * Fix python vocab hang !89 Added BucketBatchByLength Pybind switch * Added BucketBatchByLength Update and enable more tet_c_api_*.py tests !95 Add BuildSentencePeiceVocab * - Add BuildSentencePeiceVocab !96 Fix more tests * - Fix some tests - Enable more test_c_api_* - Add syncwait !99 pybind switch for device op * pybind switch for device op !93 Add getters to python API * Add getters to python API !101 Validate tree, error if graph * - Add sync wait !103 TFrecord/Random Datasets schema problem * - TfRecord/Random schem aproblem !102 Added filter pybind switch * Added Filter pybind switch !104 Fix num_samples * - TfRecord/Random schem aproblem !105 Fix to_device hang * Fix to_device hang !94 Adds Cache support for CLUE dataset * Added cache for all dataset ops * format change * Added CLUE cache support * Added Cache conversion Add save pybind fix compile err init modify concat_node !107 Fix some tests cases * Fix tests cases Enable and fix more tests !109 pybind switch for get dataset size * pybind_get_dataset_size some check-code fixes for pylint, cpplint and clang-format !113 Add callback * revert * dataset_sz 1 line * fix typo * get callback to work !114 Make Android compile clean * Make Android Compile Clean Fix build issues due to rebase !115 Fix more tests * Fix tests cases * !93 Add getters to python API fix test_profiling.py !116 fix get dataset size * fix get dataset size !117 GetColumnNames pybind switch * Added GetColumnNames pybind switch code-check fixes: clangformat, cppcheck, cpplint, pylint Delete duplicate test_c_api_*.py files; more lint fixes !121 Fix cpp tests * Remove extra call to getNext in cpp tests !122 Fix Schema with Generator * Fix Schema with Generator fix some cases of csv & mindrecord !124 fix tfrecord get_dataset_size and add some UTs * fix tfrecord get dataset size and add some ut for get_dataset_size !125 getter separation * Getter separation !126 Fix sampler.GetNumSamples * Fix sampler.GetNumSampler !127 Assign runtime getter to each get function * Assign runtime getter to each get function Fix compile issues !128 Match master code * Match master code !129 Cleanup DeviceOp/save code * Cleanup ToDevice/Save code !130 Add cache fix * Added cache fix for map and image folder !132 Fix testing team issues * Pass queue_name from python to C++ * Add Schema.from_json !131 Fix Cache op issues and delete de_pipeline * Roll back C++ change * Removed de_pipeline and passing all cache tests. * fixed cache tests !134 Cleanup datasets.py part1 * Cleanup dataset.py part1 !133 Updated validation for SentencePieceVocab.from_dataset * Added type_check for column names in SentencePieceVocab.from_dataset Rebase on master 181120 10:20 fix profiling temporary solution of catching stauts from Node.Build() !141 ToDevice Termination * ToDevice termination pylint fixes !137 Fix test team issues and add some corresponding tests * Fix test team issues and add some corresponding tests !138 TreeGetter changes to use OptPass * Getter changes to use OptPass (Zirui) Rebase fix !143 Fix cpplint issue * Fix cpplint issue pylint fixes in updated testcases !145 Reset exceptions testcase * reset exception test to master !146 Fix Check_Pylint Error * Fix Check_Pylint Error !147 fix android * fix android !148 ToDevice changes * Add ToDevice to the iterator List for cleanup at exit !149 Pylint issue * Add ToDevice to the iterator List for cleanup at exit !150 Pylint 2 * Add ToDevice to the iterator List for cleanup at exit !152 ExecutionTree error * ET destructor error !153 in getter_pass, only remove callback, without deleting map op * getter pass no longer removes map !156 early __del__ of iterator/to_device * early __del__ of iterator !155 Address review comments Eric 1 * Added one liner fix to validators.py * roll back signature fix * lint fix * Eric Address comments 2 * C++ lint fix * Address comments Eric 1 !158 Review rework for dataset bindings - part 1 * Reorder nodes repeat and rename * Review rework for dataset bindings - part 1 !154 Fixing minor problems in the comments (datasets.py, python_tree_consumer.cc, iterators_bindings.cc, and iterators.py) * Fixing minor problems in the comments (datasets.py, python_tree_consum… !157 add replace none * Add replace_none to datasets.py, address comments in tests Trying to resolve copy Override the deepcopy method of deviceop Create_ir_tree method Create_ir_tree method 2 Create_ir_tree method 2 del to_device if already exists del to_device if already exists cache getters shapes and types Added yolov3 relaxation, to be rolled back Get shapes and types together bypass yolo NumWorkers for MapOp revert Yolo revert Thor Print more info Debug code: Update LOG INFO to LOG ERROR do not remove epochctrl for getter pass Remove repeat(1) pritn batch size add log to tree_consumer and device_queue op Revert PR 8744 Signed-off-by: alex-yuyue <yue.yu1@huawei.com> __del__ toDEvice __del__ toDevice2 !165 add ifndef ENABLE_ANDROID to device queue print * Add ifndef ENABLE_ANDROID to device queue print revert some changes !166 getter: get_data_info * getter: get_data_info !168 add back tree print * revert info to warnning in one log * add back the missed print tree log Release GIL in GetDataInfo
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. # Copyright 2020-2022 Huawei Technologies Co., Ltd
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. # ==============================================================================
  15. import numpy as np
  16. import pytest
  17. import mindspore.dataset as ds
  18. import mindspore.dataset.transforms.c_transforms as c_transforms
  19. from mindspore import log as logger
  20. from util import save_and_check_md5
  21. GENERATE_GOLDEN = False
  22. IMAGENET_RAWDATA_DIR = "../data/dataset/testImageNetData2/train"
  23. IMAGENET_TFFILE_DIR = ["../data/dataset/test_tf_file_3_images2/train-0000-of-0001.data",
  24. "../data/dataset/test_tf_file_3_images2/train-0000-of-0002.data",
  25. "../data/dataset/test_tf_file_3_images2/train-0000-of-0003.data",
  26. "../data/dataset/test_tf_file_3_images2/train-0000-of-0004.data"]
  27. MNIST_DATA_DIR = "../data/dataset/testMnistData"
  28. MANIFEST_DATA_FILE = "../data/dataset/testManifestData/test.manifest"
  29. CIFAR10_DATA_DIR = "../data/dataset/testCifar10Data"
  30. COCO_DATA_DIR = "../data/dataset/testCOCO/train/"
  31. ANNOTATION_FILE = "../data/dataset/testCOCO/annotations/train.json"
  32. VOC_DATA_DIR = "../data/dataset/testVOC2012"
  33. def test_numpyslices_sampler_no_chain():
  34. """
  35. Feature: Chained Sampler
  36. Description: NumpySlicesDataset with sampler, no chain
  37. Expectation: Data verified to be correct
  38. """
  39. logger.info("test_numpyslices_sampler_no_chain")
  40. # Create NumpySlicesDataset with sampler, no chain
  41. np_data = [1, 2, 3, 4]
  42. sampler = ds.SequentialSampler(start_index=1, num_samples=2)
  43. data1 = ds.NumpySlicesDataset(np_data, sampler=sampler)
  44. # Verify dataset size
  45. data1_size = data1.get_dataset_size()
  46. logger.info("dataset size is: {}".format(data1_size))
  47. assert data1_size == 2
  48. # Verify number of rows
  49. assert sum([1 for _ in data1]) == 2
  50. # Verify dataset contents
  51. res = []
  52. for item in data1.create_tuple_iterator(num_epochs=1, output_numpy=True):
  53. logger.info("item: {}".format(item))
  54. res.append(item)
  55. logger.info("dataset: {}".format(res))
  56. np.testing.assert_array_equal(res, [[2], [3]])
  57. def test_numpyslices_sampler_chain():
  58. """
  59. Feature: Chained Sampler
  60. Description: NumpySlicesDataset with sampler chain; add child sampler with 1 statement
  61. Expectation: Data verified to be correct
  62. """
  63. logger.info("test_numpyslices_sampler_chain")
  64. # Create NumpySlicesDataset with sampler chain
  65. # Use 1 statement to add child sampler
  66. np_data = [1, 2, 3, 4]
  67. sampler = ds.SequentialSampler(start_index=1, num_samples=2)
  68. sampler.add_child(ds.SequentialSampler(start_index=1, num_samples=2))
  69. data1 = ds.NumpySlicesDataset(np_data, sampler=sampler)
  70. # Verify dataset size
  71. data1_size = data1.get_dataset_size()
  72. logger.info("dataset size is: {}".format(data1_size))
  73. assert data1_size == 1
  74. # Verify number of rows
  75. assert sum([1 for _ in data1]) == 1
  76. # Verify dataset contents
  77. res = []
  78. for item in data1.create_tuple_iterator(num_epochs=1, output_numpy=True):
  79. logger.info("item: {}".format(item))
  80. res.append(item)
  81. logger.info("dataset: {}".format(res))
  82. np.testing.assert_array_equal(res, [[3]])
  83. def test_numpyslices_sampler_chain2():
  84. """
  85. Feature: Chained Sampler
  86. Description: NumpySlicesDataset with sampler chain; add child sampler with 2 statements
  87. Expectation: Data verified to be correct
  88. """
  89. logger.info("test_numpyslices_sampler_chain2")
  90. # Create NumpySlicesDataset with sampler chain
  91. # Use 2 statements to add child sampler
  92. np_data = [1, 2, 3, 4]
  93. sampler = ds.SequentialSampler(start_index=1, num_samples=1)
  94. child_sampler = ds.SequentialSampler(start_index=1, num_samples=2)
  95. sampler.add_child(child_sampler)
  96. data1 = ds.NumpySlicesDataset(np_data, sampler=sampler)
  97. # Verify dataset size
  98. data1_size = data1.get_dataset_size()
  99. logger.info("dataset size is: {}".format(data1_size))
  100. assert data1_size == 1
  101. # Verify number of rows
  102. assert sum([1 for _ in data1]) == 1
  103. # Verify dataset contents
  104. res = []
  105. for item in data1.create_tuple_iterator(num_epochs=1, output_numpy=True):
  106. logger.info("item: {}".format(item))
  107. res.append(item)
  108. logger.info("dataset: {}".format(res))
  109. np.testing.assert_array_equal(res, [[3]])
  110. def test_numpyslices_sampler_chain_multi_add_child():
  111. """
  112. Feature: Chained Sampler
  113. Description: NumpySlicesDataset with sampler chain with multiple add_child() invocations
  114. Expectation: Data verified to be correct. Only last add_child() invocation is effective.
  115. """
  116. logger.info("test_numpyslices_sampler_chain_multi_add_child")
  117. # Create NumpySlicesDataset with sampler chain
  118. # Call add_child() multiple times in succession
  119. # Note: A subsequent add_child() invocation replaces the prior child sampler (if any).
  120. np_data = [1, 2, 3, 4, 5, 6, 7, 8]
  121. sampler = ds.SequentialSampler(start_index=1, num_samples=None)
  122. # 1st add_child invocation
  123. sampler.add_child(ds.SequentialSampler(start_index=4, num_samples=1))
  124. # 2nd add_child invocation
  125. sampler.add_child(ds.SequentialSampler(start_index=4, num_samples=2))
  126. # 3rd add_child invocation
  127. sampler.add_child(ds.SequentialSampler(start_index=4, num_samples=3))
  128. # 4th and last add_child invocation which is the effective child sampler
  129. sampler.add_child(ds.SequentialSampler(start_index=1, num_samples=6))
  130. data1 = ds.NumpySlicesDataset(np_data, sampler=sampler)
  131. # Verify dataset size
  132. data1_size = data1.get_dataset_size()
  133. logger.info("dataset size is: {}".format(data1_size))
  134. assert data1_size == 5
  135. # Verify number of rows
  136. assert sum([1 for _ in data1]) == 5
  137. # Verify dataset contents
  138. res = []
  139. for item in data1.create_tuple_iterator(num_epochs=1, output_numpy=True):
  140. logger.info("item: {}".format(item))
  141. res.append(item)
  142. logger.info("dataset: {}".format(res))
  143. np.testing.assert_array_equal(res, [[3], [4], [5], [6], [7]])
  144. def test_imagefolder_sampler_chain():
  145. """
  146. Test ImageFolderDataset sampler chain
  147. """
  148. logger.info("test_imagefolder_sampler_chain")
  149. sampler = ds.SequentialSampler(start_index=1, num_samples=3)
  150. child_sampler = ds.PKSampler(2)
  151. sampler.add_child(child_sampler)
  152. data1 = ds.ImageFolderDataset(IMAGENET_RAWDATA_DIR, sampler=sampler)
  153. # Verify dataset size
  154. data1_size = data1.get_dataset_size()
  155. logger.info("dataset size is: {}".format(data1_size))
  156. assert data1_size == 3
  157. # Verify number of rows
  158. assert sum([1 for _ in data1]) == 3
  159. # Verify dataset contents
  160. res = []
  161. for item in data1.create_tuple_iterator(num_epochs=1, output_numpy=True):
  162. logger.info("item: {}".format(item))
  163. res.append(item)
  164. logger.info("dataset: {}".format(res))
  165. def test_mnist_sampler_chain():
  166. """
  167. Test Mnist sampler chain
  168. """
  169. logger.info("test_mnist_sampler_chain")
  170. sampler = ds.DistributedSampler(num_shards=1, shard_id=0, shuffle=False, num_samples=3, offset=1)
  171. child_sampler = ds.RandomSampler(replacement=True, num_samples=4)
  172. sampler.add_child(child_sampler)
  173. data1 = ds.MnistDataset(MNIST_DATA_DIR, sampler=sampler)
  174. # Verify dataset size
  175. data1_size = data1.get_dataset_size()
  176. logger.info("dataset size is: {}".format(data1_size))
  177. assert data1_size == 3
  178. # Verify number of rows
  179. assert sum([1 for _ in data1]) == 3
  180. # Verify dataset contents
  181. res = []
  182. for item in data1.create_tuple_iterator(num_epochs=1, output_numpy=True):
  183. logger.info("item: {}".format(item))
  184. res.append(item)
  185. logger.info("dataset: {}".format(res))
  186. def test_manifest_sampler_chain():
  187. """
  188. Test Manifest sampler chain
  189. """
  190. logger.info("test_manifest_sampler_chain")
  191. sampler = ds.RandomSampler(replacement=True, num_samples=2)
  192. child_sampler = ds.DistributedSampler(num_shards=1, shard_id=0, shuffle=False, num_samples=3, offset=1)
  193. sampler.add_child(child_sampler)
  194. data1 = ds.ManifestDataset(MANIFEST_DATA_FILE, sampler=sampler)
  195. # Verify dataset size
  196. data1_size = data1.get_dataset_size()
  197. logger.info("dataset size is: {}".format(data1_size))
  198. assert data1_size == 2
  199. # Verify number of rows
  200. assert sum([1 for _ in data1]) == 2
  201. # Verify dataset contents
  202. res = []
  203. for item in data1.create_tuple_iterator(num_epochs=1, output_numpy=True):
  204. logger.info("item: {}".format(item))
  205. res.append(item)
  206. logger.info("dataset: {}".format(res))
  207. def test_coco_sampler_chain():
  208. """
  209. Test Coco sampler chain
  210. """
  211. logger.info("test_coco_sampler_chain")
  212. sampler = ds.DistributedSampler(num_shards=2, shard_id=0, shuffle=False, num_samples=5)
  213. child_sampler = ds.RandomSampler(replacement=True, num_samples=2)
  214. sampler.add_child(child_sampler)
  215. data1 = ds.CocoDataset(COCO_DATA_DIR, annotation_file=ANNOTATION_FILE, task="Detection", decode=True,
  216. sampler=sampler)
  217. # Verify dataset size
  218. data1_size = data1.get_dataset_size()
  219. logger.info("dataset size is: {}".format(data1_size))
  220. assert data1_size == 1
  221. # Verify number of rows
  222. assert sum([1 for _ in data1]) == 1
  223. # Verify dataset contents
  224. res = []
  225. for item in data1.create_tuple_iterator(num_epochs=1, output_numpy=True):
  226. logger.info("item: {}".format(item))
  227. res.append(item)
  228. logger.info("dataset: {}".format(res))
  229. def test_cifar_sampler_chain():
  230. """
  231. Test Cifar sampler chain
  232. """
  233. logger.info("test_cifar_sampler_chain")
  234. sampler = ds.DistributedSampler(num_shards=2, shard_id=0, shuffle=False, num_samples=5)
  235. child_sampler = ds.RandomSampler(replacement=True, num_samples=4)
  236. child_sampler2 = ds.SequentialSampler(start_index=0, num_samples=2)
  237. child_sampler.add_child(child_sampler2)
  238. sampler.add_child(child_sampler)
  239. data1 = ds.Cifar10Dataset(CIFAR10_DATA_DIR, sampler=sampler)
  240. # Verify dataset size
  241. data1_size = data1.get_dataset_size()
  242. logger.info("dataset size is: {}".format(data1_size))
  243. assert data1_size == 1
  244. # Verify number of rows
  245. assert sum([1 for _ in data1]) == 1
  246. # Verify dataset contents
  247. res = []
  248. for item in data1.create_tuple_iterator(num_epochs=1, output_numpy=True):
  249. logger.info("item: {}".format(item))
  250. res.append(item)
  251. logger.info("dataset: {}".format(res))
  252. def test_voc_sampler_chain():
  253. """
  254. Test VOC sampler chain
  255. """
  256. logger.info("test_voc_sampler_chain")
  257. sampler = ds.DistributedSampler(num_shards=2, shard_id=0, shuffle=False, num_samples=5)
  258. child_sampler = ds.SequentialSampler(start_index=0)
  259. sampler.add_child(child_sampler)
  260. data1 = ds.VOCDataset(VOC_DATA_DIR, task="Segmentation", sampler=sampler)
  261. # Verify dataset size
  262. data1_size = data1.get_dataset_size()
  263. logger.info("dataset size is: {}".format(data1_size))
  264. assert data1_size == 5
  265. # Verify number of rows
  266. assert sum([1 for _ in data1.create_dict_iterator(num_epochs=1, output_numpy=True)]) == 5
  267. # Verify dataset contents
  268. res = []
  269. for item in data1.create_tuple_iterator(num_epochs=1, output_numpy=True):
  270. logger.info("item: {}".format(item))
  271. res.append(item)
  272. logger.info("dataset: {}".format(res))
  273. def test_numpyslices_sampler_chain_batch():
  274. """
  275. Test NumpySlicesDataset sampler chaining, with batch
  276. """
  277. logger.info("test_numpyslices_sampler_chain_batch")
  278. # Create NumpySlicesDataset with sampler chain
  279. np_data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  280. sampler = ds.SequentialSampler(start_index=1, num_samples=8)
  281. sampler.add_child(ds.SequentialSampler(start_index=1, num_samples=9))
  282. data1 = ds.NumpySlicesDataset(np_data, sampler=sampler)
  283. data1 = data1.batch(batch_size=2, drop_remainder=False)
  284. # Verify dataset size
  285. data1_size = data1.get_dataset_size()
  286. logger.info("dataset size is: {}".format(data1_size))
  287. assert data1_size == 4
  288. # Verify number of rows
  289. assert sum([1 for _ in data1]) == 4
  290. # Verify dataset contents
  291. res = []
  292. for item in data1.create_tuple_iterator(num_epochs=1, output_numpy=True):
  293. logger.info("item: {}".format(item))
  294. res.append(item)
  295. logger.info("dataset: {}".format(res))
  296. np.testing.assert_array_equal(res, [[[3, 4]], [[5, 6]], [[7, 8]], [[9, 10]]])
  297. def test_sampler_chain_errors():
  298. """
  299. Test error cases for sampler chains
  300. """
  301. logger.info("test_sampler_chain_errors")
  302. error_msg_1 = "'NoneType' object has no attribute 'add_child'"
  303. # Test add child sampler within child sampler
  304. sampler = ds.SequentialSampler(start_index=1, num_samples=2)
  305. sampler = sampler.add_child(ds.SequentialSampler(start_index=1, num_samples=2))
  306. with pytest.raises(AttributeError, match=error_msg_1):
  307. sampler.add_child(ds.SequentialSampler(start_index=1, num_samples=2))
  308. error_msg_3 = "Conflicting arguments during sampler assignments."
  309. # Test conflicting arguments (sampler and shuffle=False) for sampler (no chain)
  310. np_data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  311. sampler = ds.SequentialSampler(start_index=1, num_samples=3)
  312. with pytest.raises(ValueError, match=error_msg_3):
  313. ds.NumpySlicesDataset(np_data, shuffle=False, sampler=sampler)
  314. error_msg_4 = "Conflicting arguments during sampler assignments."
  315. # Test conflicting arguments (sampler and shuffle=False) for sampler chaining
  316. np_data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  317. sampler = ds.SequentialSampler(start_index=1, num_samples=3)
  318. sampler.add_child(ds.SequentialSampler(start_index=1, num_samples=2))
  319. with pytest.raises(ValueError, match=error_msg_4):
  320. ds.NumpySlicesDataset(np_data, shuffle=False, sampler=sampler)
  321. def test_manifest_sampler_chain_repeat():
  322. """
  323. Test ManifestDataset sampler chain DistributedSampler->SequentialSampler, with repeat
  324. """
  325. logger.info("test_manifest_sampler_chain_batch")
  326. manifest_file = "../data/dataset/testManifestData/test5trainimgs.json"
  327. # Create sampler chain DistributedSampler->SequentialSampler
  328. sampler = ds.DistributedSampler(num_shards=1, shard_id=0, shuffle=False, num_samples=5)
  329. child_sampler = ds.SequentialSampler()
  330. sampler.add_child(child_sampler)
  331. # Create ManifestDataset with sampler chain
  332. data1 = ds.ManifestDataset(manifest_file, sampler=sampler)
  333. data1 = data1.repeat(count=2)
  334. # Verify dataset size
  335. data1_size = data1.get_dataset_size()
  336. logger.info("dataset size is: {}".format(data1_size))
  337. assert data1_size == 10
  338. # Verify number of rows
  339. assert sum([1 for _ in data1]) == 10
  340. # Verify dataset contents
  341. filename = "sampler_chain_manifest_repeat_result.npz"
  342. save_and_check_md5(data1, filename, generate_golden=GENERATE_GOLDEN)
  343. def test_manifest_sampler_chain_batch_repeat():
  344. """
  345. Test ManifestDataset sampler chain DistributedSampler->SequentialSampler, with batch then repeat
  346. """
  347. logger.info("test_manifest_sampler_chain_batch_repeat")
  348. manifest_file = "../data/dataset/testManifestData/test5trainimgs.json"
  349. # Create sampler chain DistributedSampler->SequentialSampler
  350. sampler = ds.DistributedSampler(num_shards=1, shard_id=0, shuffle=False, num_samples=5)
  351. child_sampler = ds.SequentialSampler()
  352. sampler.add_child(child_sampler)
  353. # Create ManifestDataset with sampler chain
  354. data1 = ds.ManifestDataset(manifest_file, decode=True, sampler=sampler)
  355. one_hot_encode = c_transforms.OneHot(3)
  356. data1 = data1.map(operations=one_hot_encode, input_columns=["label"])
  357. data1 = data1.batch(batch_size=1, drop_remainder=False)
  358. data1 = data1.repeat(count=2)
  359. # Verify dataset size
  360. data1_size = data1.get_dataset_size()
  361. logger.info("dataset size is: {}".format(data1_size))
  362. assert data1_size == 10
  363. # Verify number of rows
  364. assert sum([1 for _ in data1]) == 10
  365. if __name__ == '__main__':
  366. test_numpyslices_sampler_no_chain()
  367. test_numpyslices_sampler_chain()
  368. test_numpyslices_sampler_chain2()
  369. test_numpyslices_sampler_chain_multi_add_child()
  370. test_imagefolder_sampler_chain()
  371. test_mnist_sampler_chain()
  372. test_manifest_sampler_chain()
  373. test_coco_sampler_chain()
  374. test_cifar_sampler_chain()
  375. test_voc_sampler_chain()
  376. test_numpyslices_sampler_chain_batch()
  377. test_sampler_chain_errors()
  378. test_manifest_sampler_chain_repeat()
  379. test_manifest_sampler_chain_batch_repeat()