Skip to content

Commit e42a0d5

Browse files
committed
Fix index access to new OneHotArray
1 parent a52d343 commit e42a0d5

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
@@ -193,14 +193,14 @@ for wrapper in [:Adjoint, :Transpose]
193193
size(A, 2) == L ||
194194
throw(DimensionMismatch("Matrix column must correspond with OneHot size: $(size(A, 2)) != $L"))
195195

196-
return A[:, b.ix]
196+
return A[:, onecold(b)]
197197
end
198198

199199
function Base.:*(A::$wrapper{<:Number, <:AbstractVector{T}}, b::OneHotVector{<:Any, L}) where {L, T}
200200
size(A, 2) == L ||
201201
throw(DimensionMismatch("Matrix column must correspond with OneHot size: $(size(A, 2)) != $L"))
202202

203-
return A[b.ix]
203+
return A[onecold(b)]
204204
end
205205
end
206206
end

0 commit comments

Comments
 (0)