Skip to content

Commit 1914f38

Browse files
authored
using OneHotArrays (#2025)
* using OneHotArrays * rm tests * skip a test * don't export, add depwarns * back to using
1 parent a377cb0 commit 1914f38

File tree

6 files changed

+5
-498
lines changed

6 files changed

+5
-498
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
1313
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
1414
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
1515
NNlibCUDA = "a00861dc-f156-4864-bf3c-e6376f28a68d"
16+
OneHotArrays = "0b1bfda6-eb8a-41d2-88d8-f5af5cad476f"
1617
Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2"
1718
ProgressLogging = "33c8b6b6-d38a-422a-b730-caa89a2f386c"
1819
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
@@ -34,6 +35,7 @@ MLUtils = "0.2"
3435
MacroTools = "0.5"
3536
NNlib = "0.8.9"
3637
NNlibCUDA = "0.2.4"
38+
OneHotArrays = "0.1"
3739
Optimisers = "0.2.1"
3840
ProgressLogging = "0.1"
3941
Reexport = "0.2, 1.0"

src/Flux.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export Descent, Adam, Momentum, Nesterov, RMSProp,
3737
using CUDA
3838
const use_cuda = Ref{Union{Nothing,Bool}}(nothing)
3939

40+
using Adapt, Functors, OneHotArrays
4041
include("utils.jl")
41-
include("onehot.jl")
4242
include("functor.jl")
4343

4444
# Pirate error to catch a common mistake.

src/onehot.jl

Lines changed: 0 additions & 290 deletions
This file was deleted.

test/cuda/cuda.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ end
4949
# construct from CuArray
5050
x = [1, 3, 2]
5151
y = Flux.onehotbatch(x, 0:3)
52+
@test_skip begin # https://github.com/FluxML/OneHotArrays.jl/issues/16
5253
y2 = Flux.onehotbatch(x |> gpu, 0:3)
5354
@test y2.indices isa CuArray
5455
@test y2 |> cpu == y
56+
end
5557
end
5658

5759
@testset "onecold gpu" begin

0 commit comments

Comments
 (0)