Skip to content

Commit 5e5dc7d

Browse files
committed
fixed doctests
1 parent eb15e85 commit 5e5dc7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/onehot.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ onehotbatch(data, labels, default...) = _onehotbatch(data, length(labels) < 32 ?
187187

188188
# NB function barrier:
189189
function _onehotbatch(data, labels)
190-
indices = [_findval(i, labels) for i in data]
190+
indices = UInt32[_findval(i, labels) for i in data]
191191
if nothing in indices
192192
unexpected_values = unique(data[indices .== nothing])
193193
error("Values $unexpected_values are not in labels")
@@ -198,7 +198,7 @@ end
198198
function _onehotbatch(data, labels, default)
199199
default_index = _findval(default, labels)
200200
isnothing(default_index) && error("Default value $default is not in labels")
201-
indices = [isnothing(_findval(i, labels)) ? default_index : _findval(i, labels) for i in data]
201+
indices = UInt32[isnothing(_findval(i, labels)) ? default_index : _findval(i, labels) for i in data]
202202
return OneHotArray(indices, length(labels))
203203
end
204204

0 commit comments

Comments
 (0)