|
57 | 57 |
|
58 | 58 | # this is from /LinearAlgebra/src/diagonal.jl, official way to print the dots:
|
59 | 59 | function Base.replace_in_print_matrix(x::OneHotLike, i::Integer, j::Integer, s::AbstractString)
|
60 |
| - # CUDA.@allowscalar(x[i,j]) ? s : _isonehot(x) ? Base.replace_with_centered_mark(s) : s |
61 | 60 | x[i,j] ? s : _isonehot(x) ? Base.replace_with_centered_mark(s) : s
|
62 | 61 | end
|
63 | 62 | function Base.replace_in_print_matrix(x::LinearAlgebra.AdjOrTrans{Bool, <:OneHotLike}, i::Integer, j::Integer, s::AbstractString)
|
64 |
| - CUDA.@allowscalar(x[i,j]) ? s : _isonehot(parent(x)) ? Base.replace_with_centered_mark(s) : s |
| 63 | + x[i,j] ? s : _isonehot(parent(x)) ? Base.replace_with_centered_mark(s) : s |
65 | 64 | end
|
66 | 65 |
|
67 |
| -# Base.show(io::IO, x::OneHotLike) = show(io, convert(Array{Bool}, cpu(x))) # helps string(cu(y)) |
68 |
| - |
69 | 66 | Base.print_array(io::IO, X::OneHotLike{T, L, N, var"N+1", <:CuArray}) where {T, L, N, var"N+1"} =
|
70 | 67 | Base.print_array(io, cpu(X))
|
| 68 | +Base.print_array(io::IO, X::LinearAlgebra.AdjOrTrans{Bool, <:OneHotLike{T, L, N, var"N+1", <:CuArray}}) where {T, L, N, var"N+1"} = |
| 69 | + Base.print_array(io, cpu(X)) |
71 | 70 |
|
72 | 71 | _onehot_bool_type(x::OneHotLike{<:Any, <:Any, <:Any, N, <:Union{Integer, AbstractArray}}) where N = Array{Bool, N}
|
73 | 72 | _onehot_bool_type(x::OneHotLike{<:Any, <:Any, <:Any, N, <:CuArray}) where N = CuArray{Bool, N}
|
|
0 commit comments