Skip to content

Commit

Permalink
Restore default value for seed for the sake of tests.
Browse files Browse the repository at this point in the history
Add more missing AddRandomSeedArg.
Change seed in resize tests (now it got "unlucky" one).

Signed-off-by: Michał Zientkiewicz <[email protected]>
  • Loading branch information
mzient committed Dec 9, 2024
1 parent d3d7816 commit 777dd78
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions dali/operators/generic/roi_random_crop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ either specified with `roi_start`/`roi_end` or `roi_start`/`roi_shape`.
The operator produces an output representing the cropping window start coordinates.
)code")
.AddRandomSeedArg()
.AddArg("crop_shape",
R"code(Cropping window dimensions.)code", DALI_INT_VEC, true)
.AddArg("roi_start",
Expand Down
2 changes: 1 addition & 1 deletion dali/pipeline/operator/op_schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ OpSchema &OpSchema::AddOptionalTypeArg(std::string_view s, std::string doc) {
OpSchema &OpSchema::AddRandomSeedArg() {
AddOptionalArg<int>("seed",
"Random seed; if not set, one will be assigned automatically.",
nullptr);
-1);
return *this;
}

Expand Down
2 changes: 1 addition & 1 deletion dali/test/python/operator_1/test_crop.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ def get_data():
pipe = get_pipe(batch_size=batch_size, device_id=0, num_threads=3)
pipe.build()
with assert_raises(
RuntimeError, glob=f'The layout "{layout}" does not match any of the allowed layouts'
ValueError, glob=f'The layout "{layout}" does not match any of the allowed layouts'
):
pipe.run()

Expand Down
2 changes: 1 addition & 1 deletion dali/test/python/operator_1/test_crop_mirror_normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ def get_data():
pipe = get_pipe(batch_size=batch_size, device_id=0, num_threads=3)
pipe.build()
with assert_raises(
RuntimeError, glob=f'The layout "{layout}" does not match any of the allowed layouts'
ValueError, glob=f'The layout "{layout}" does not match any of the allowed layouts'
):
pipe.run()

Expand Down
2 changes: 1 addition & 1 deletion dali/test/python/operator_2/test_resize.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def build_pipes(
batch_size=batch_size,
num_threads=8,
device_id=0,
seed=1234,
seed=12345,
exec_async=False,
exec_pipelined=False,
)
Expand Down

0 comments on commit 777dd78

Please sign in to comment.