|
1 | | -# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. |
| 1 | +# Copyright (c) 2020-2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
2 | 2 | # |
3 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | # you may not use this file except in compliance with the License. |
@@ -891,6 +891,17 @@ def get_data(): |
891 | 891 | return out |
892 | 892 | check_single_input(fn.squeeze, axis_names="YZ", get_data=get_data, input_layout="HWCYZ") |
893 | 893 |
|
| 894 | +def test_select_cpu(): |
| 895 | + pipe = Pipeline(batch_size=batch_size, num_threads=3, device_id=None) |
| 896 | + data = fn.external_source(source=get_data, layout="HWC") |
| 897 | + data2 = fn.external_source(source=get_data, layout="HWC") |
| 898 | + data3 = fn.external_source(source=get_data, layout="HWC") |
| 899 | + idx = fn.random.uniform(range=[0, 3], dtype=types.INT32) |
| 900 | + pipe.set_outputs(fn.select(data, data2, data3, input_idx=idx)) |
| 901 | + pipe.build() |
| 902 | + for _ in range(3): |
| 903 | + pipe.run() |
| 904 | + |
894 | 905 | def test_peek_image_shape_cpu(): |
895 | 906 | pipe = Pipeline(batch_size=batch_size, num_threads=4, device_id=None) |
896 | 907 | input, _ = fn.readers.file(file_root=images_dir, shard_id=0, num_shards=1) |
@@ -1025,6 +1036,7 @@ def test_separated_exec_setup(): |
1025 | 1036 | "resize_crop_mirror", |
1026 | 1037 | "fast_resize_crop_mirror", |
1027 | 1038 | "segmentation.select_masks", |
| 1039 | + "select", |
1028 | 1040 | "slice", |
1029 | 1041 | "segmentation.random_mask_pixel", |
1030 | 1042 | "transpose", |
|
0 commit comments