Skip to content

Commit a52d343

Browse files
committed
Fix logic error in checks
1 parent 7576e8f commit a52d343

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
@@ -190,14 +190,14 @@ end
190190
for wrapper in [:Adjoint, :Transpose]
191191
@eval begin
192192
function Base.:*(A::$wrapper{<:Any, <:AbstractMatrix{T}}, b::OneHotVector{<:Any, L}) where {L, T}
193-
size(A, 2) != L ||
193+
size(A, 2) == L ||
194194
throw(DimensionMismatch("Matrix column must correspond with OneHot size: $(size(A, 2)) != $L"))
195195

196196
return A[:, b.ix]
197197
end
198198

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

203203
return A[b.ix]

0 commit comments

Comments
 (0)