Skip to content

Commit 9ca5939

Browse files
add shuffle test and news
1 parent fcfdbeb commit 9ca5939

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ been removed in favour of MLDatasets.jl.
77
* `flatten` is not exported anymore due to clash with Iterators.flatten.
88
* Remove Juno.jl progress bar support as it is now obsolete.
99
* `Dropout` gained improved compatibility with Int and Complex arrays and is now twice-differentiable.
10+
* Many utily functions and the `DataLoader` are [now provided by MLUtils.jl](https://github.com/FluxML/Flux.jl/pull/1874).
11+
* The DataLoader is now compatible with generic dataset types implementing `MLUtils.numobs` and `MLUtils.getobs`.
1012

1113
## v0.12.10
1214
* `Dropout`/`AlphaDropout` now supports [user-specified RNGs](https://github.com/FluxML/Flux.jl/pull/1838)

test/data.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ using Random
6565
@test batches[3][1] == batches[3].x == X[:,5:5]
6666
@test batches[3][2] == batches[3].y == Y[5:5]
6767

68+
# Don't mutate state https://github.com/FluxML/Flux.jl/issues/1227
69+
d = DataLoader([1:10;], shuffle=true)
70+
cd = collect(zip(d, d))
71+
# skip the first since it used to be different also before fixing the bug
72+
@test [cd[i][1] for i=2:10] != [cd[i][2] for i=2:10]
73+
6874
# test interaction with `train!`
6975
θ = ones(2)
7076
X = zeros(2, 10)

0 commit comments

Comments
 (0)