Skip to content

Commit 76b1fca

Browse files
committed
Specify mime in test
1 parent b1c8c7c commit 76b1fca

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/onehot.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ function _show_elements(x::OneHotArray)
2525
return xrepr
2626
end
2727

28-
function Base.show(io::IO, x::OneHotArray{<:Any, L, <:Any, N, I}) where {L, N, I}
28+
function Base.show(io::IO, ::MIME"text/plain", x::OneHotArray{<:Any, L, <:Any, N, I}) where {L, N, I}
2929
join(io, string.(size(x)), "×")
3030
print(io, " Flux.OneHotArray{")
3131
join(io, string.([L, N, I]), ",")
3232
println(io, "}:")
3333
print(io, _show_elements(x))
3434
end
35-
function Base.show(io::IO, x::OneHotVector{T, L}) where {T, L}
35+
function Base.show(io::IO, ::MIME"text/plain", x::OneHotVector{T, L}) where {T, L}
3636
print(io, string.(length(x)))
3737
print(io, "-element Flux.OneHotVector{")
3838
join(io, string.([L, T]), ",")

test/cuda/cuda.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ end
4040

4141
@testset "onehot gpu" begin
4242
y = Flux.onehotbatch(ones(3), 1:2) |> gpu;
43-
@test (show(y); true)
43+
@test (show("text/plain", y); true)
4444
end
4545

4646
@testset "onecold gpu" begin

0 commit comments

Comments
 (0)