comment fix
This commit is contained in:
parent
bd6158d7f9
commit
e243950e28
@ -28,7 +28,7 @@ Base.getindex(xs::Flux.OneHotMatrix, j::Base.UnitRange, i::Int) = xs.data[i][j]
|
|||||||
|
|
||||||
Base.getindex(xs::OneHotMatrix, ::Colon, ::Colon) = xs
|
Base.getindex(xs::OneHotMatrix, ::Colon, ::Colon) = xs
|
||||||
|
|
||||||
# handle special case for when we want the entire column without allocating
|
# handle special case for when we want the entire column
|
||||||
function Base.getindex(xs::Flux.OneHotMatrix{T}, ot::Union{Base.Slice, Base.OneTo}, i::Int) where {T<:AbstractArray}
|
function Base.getindex(xs::Flux.OneHotMatrix{T}, ot::Union{Base.Slice, Base.OneTo}, i::Int) where {T<:AbstractArray}
|
||||||
res = similar(xs, size(xs, 1), 1)
|
res = similar(xs, size(xs, 1), 1)
|
||||||
if length(ot) == size(xs, 1)
|
if length(ot) == size(xs, 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user