Skip to content

Commit 7ce132f

Browse files
committed
using gather for OneHotLike
1 parent 75f0e9c commit 7ce132f

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/onehot.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,6 @@ end
222222

223223
function Base.:(*)(A::AbstractMatrix, B::OneHotLike{<:Any, L}) where L
224224
_isonehot(B) || return invoke(*, Tuple{AbstractMatrix, AbstractMatrix}, A, B)
225-
size(A, 2) == L || throw(DimensionMismatch("Matrix column must correspond with OneHot size: $(size(A, 2)) != $L"))
226-
return A[:, onecold(B)]
227-
end
228-
229-
function Base.:(*)(A::AbstractMatrix, B::OneHotMatrix{<:Any, L}) where L
230225
size(A, 2) == L || throw(DimensionMismatch("Matrix column must correspond with OneHot size: $(size(A, 2)) != $L"))
231226
return NNlib.gather(A, _indices(B))
232227
end

0 commit comments

Comments
 (0)