Skip to content

Commit

Permalink
Fix logic error in checks
Browse files Browse the repository at this point in the history
  • Loading branch information
darsnack committed Jun 15, 2021
1 parent 7576e8f commit a52d343
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/onehot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ end
for wrapper in [:Adjoint, :Transpose]
@eval begin
function Base.:*(A::$wrapper{<:Any, <:AbstractMatrix{T}}, b::OneHotVector{<:Any, L}) where {L, T}
size(A, 2) != L ||
size(A, 2) == L ||
throw(DimensionMismatch("Matrix column must correspond with OneHot size: $(size(A, 2)) != $L"))

return A[:, b.ix]
end

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

return A[b.ix]
Expand Down

0 comments on commit a52d343

Please sign in to comment.