deep-learning-koans icon indicating copy to clipboard operation
deep-learning-koans copied to clipboard

Random seed koan not working

Open Haksell opened this issue 3 years ago • 0 comments

I changed the seed to 42 as indicated in the source file, but still fail the test. I'm guessing Julia has changed its randomness mechanism between 1.2 (the one you assume) and 1.5 (the one I use), so not sure an issue is in order.

using Random
aboutkoan = "set the myseed equal to something else, besides 1"
myseed = 42
Random.seed!(myseed)
@test rand(1:10^20) == 5590813852184710016
Test Failed at In[10]:5
  Expression: rand(1:10 ^ 20) == 5590813852184710016
   Evaluated: 2353793361580022217 == 5590813852184710016
There was an error during testing

Stacktrace:
 [1] record(::Test.FallbackTestSet, ::Union{Test.Error, Test.Fail}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Test/src/Test.jl:737
 [2] do_test(::Test.ExecutionResult, ::Any) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Test/src/Test.jl:520
 [3] top-level scope at In[10]:5

Haksell avatar Mar 05 '21 16:03 Haksell