Skip to content

Commit 220006f

Browse files
authored
fix nondeterminism in tesseract_main.cc
by default, tesseract should have deterministic behavior on the same data. This was broken accidentally through use of a hardware random seed by default for the det order generation. here we fix it to a particular random seed by default.
1 parent 47d0e70 commit 220006f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tesseract_main.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ int main(int argc, char* argv[]) {
326326
"Seed used when initializing the random detector traversal "
327327
"orderings.")
328328
.metavar("N")
329-
.default_value(static_cast<uint64_t>(std::random_device()()))
329+
.default_value(static_cast<uint64_t>(518278944))
330330
.store_into(args.det_order_seed);
331331
program.add_argument("--sample-num-shots")
332332
.help(
@@ -627,4 +627,4 @@ int main(int argc, char* argv[]) {
627627
std::cout << " total_time_seconds = " << total_time_seconds;
628628
std::cout << std::endl;
629629
}
630-
}
630+
}

0 commit comments

Comments
 (0)