Skip to content

Commit 23ae133

Browse files
committed
Add cpu-only test.
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
1 parent c27f49a commit 23ae133

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

dali/test/python/test_dali_cpu_only.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
1+
# Copyright (c) 2020-2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -891,6 +891,17 @@ def get_data():
891891
return out
892892
check_single_input(fn.squeeze, axis_names="YZ", get_data=get_data, input_layout="HWCYZ")
893893

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+
894905
def test_peek_image_shape_cpu():
895906
pipe = Pipeline(batch_size=batch_size, num_threads=4, device_id=None)
896907
input, _ = fn.readers.file(file_root=images_dir, shard_id=0, num_shards=1)
@@ -1025,6 +1036,7 @@ def test_separated_exec_setup():
10251036
"resize_crop_mirror",
10261037
"fast_resize_crop_mirror",
10271038
"segmentation.select_masks",
1039+
"select",
10281040
"slice",
10291041
"segmentation.random_mask_pixel",
10301042
"transpose",

dali/test/python/test_operator_select.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,4 @@ def check(device):
154154
assert "valid layout" in str(e), "Unexpected exception"
155155

156156
for device in ["gpu", "cpu"]:
157-
yield check, device
157+
yield check, device

0 commit comments

Comments
 (0)