fix mnist loader

This commit is contained in:
Mike Innes 2018-08-20 16:57:43 +01:00
parent 86683e5991
commit 216d278e7b
3 changed files with 6 additions and 1 deletions

View File

@ -11,6 +11,8 @@ function __init__()
end
include("mnist.jl")
export MNIST
include("cmudict.jl")
using .CMUDict

View File

@ -49,7 +49,7 @@ function labelheader(io::IO)
end
function rawimage(io::IO)
img = Array{Gray}(NCOLS, NROWS)
img = Array{Gray}(undef, NCOLS, NROWS)
for i in 1:NCOLS, j in 1:NROWS
img[i, j] = reinterpret(Colors.N0f8, read(io, UInt8))
end

View File

@ -6,3 +6,6 @@ using Test
@test length(CMUDict.phones()) == 39
@test length(CMUDict.symbols()) == 84
@test MNIST.images()[1] isa Matrix
@test MNIST.labels() isa Vector{Int64}