Skip to content

Commit 4fb6fe9

Browse files
committed
use N and N+1 more consistently
1 parent ffb6f00 commit 4fb6fe9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/array.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ Base.print_array(io::IO, X::OneHotLike{T, L, N, var"N+1", <:AbstractGPUArray}) w
6666
Base.print_array(io::IO, X::LinearAlgebra.AdjOrTrans{Bool, <:OneHotLike{T, L, N, var"N+1", <:AbstractGPUArray}}) where {T, L, N, var"N+1"} =
6767
Base.print_array(io, adapt(Array, X))
6868

69-
_onehot_bool_type(::OneHotLike{<:Any, <:Any, <:Any, N, <:Union{Integer, AbstractArray}}) where N = Array{Bool, N}
70-
_onehot_bool_type(::OneHotLike{<:Any, <:Any, <:Any, N, <:AbstractGPUArray}) where N = AbstractGPUArray{Bool, N}
69+
_onehot_bool_type(::OneHotLike{<:Any, <:Any, <:Any, var"N+1", <:Union{Integer, AbstractArray}}) where {var"N+1"} = Array{Bool, var"N+1"}
70+
_onehot_bool_type(::OneHotLike{<:Any, <:Any, <:Any, var"N+1", <:AbstractGPUArray}) where {var"N+1"} = AbstractGPUArray{Bool, var"N+1"}
7171

7272
function Base.cat(x::OneHotLike{<:Any, L}, xs::OneHotLike{<:Any, L}...; dims::Int) where L
7373
if isone(dims) || any(x -> !_isonehot(x), (x, xs...))

src/onehot.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ nonzero elements.
5757
If one of the inputs in `xs` is not found in `labels`, that column is `onehot(default, labels)`
5858
if `default` is given, else an error.
5959
60-
If `xs` has more dimensions, `M = ndims(xs) > 1`, then the result is an
61-
`AbstractArray{Bool, M+1}` which is one-hot along the first dimension,
60+
If `xs` has more dimensions, `N = ndims(xs) > 1`, then the result is an
61+
`AbstractArray{Bool, N+1}` which is one-hot along the first dimension,
6262
i.e. `result[:, k...] == onehot(xs[k...], labels)`.
6363
6464
Note that `xs` can be any iterable, such as a string. And that using a tuple

0 commit comments

Comments
 (0)