use @inbounds

This commit is contained in:
Yao Lu 2020-05-09 19:40:46 +08:00
parent 63cb70dd23
commit 888f286c51
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ Base.getindex(xs::OneHotMatrix, ::Colon, ::Colon) = OneHotMatrix(xs.height, copy
Base.getindex(xs::OneHotMatrix, i::Integer, ::Colon) = map(x -> x[i], xs.data)
A::AbstractMatrix * B::OneHotMatrix = A[:, cpu(map(x->x.ix, B.data))]
A::AbstractMatrix * B::OneHotMatrix = @inbounds A[:, map(x->x.ix, B.data)]
Base.hcat(x::OneHotVector, xs::OneHotVector...) = OneHotMatrix(length(x), [x, xs...])