Skip to content

Commit

Permalink
using OneHotArrays (FluxML#2025)
Browse files Browse the repository at this point in the history
* using OneHotArrays

* rm tests

* skip a test

* don't export, add depwarns

* back to using
  • Loading branch information
mcabbott authored and Saransh-cpp committed Aug 11, 2022
1 parent 7bf3581 commit 08d655d
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 498 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
NNlibCUDA = "a00861dc-f156-4864-bf3c-e6376f28a68d"
OneHotArrays = "0b1bfda6-eb8a-41d2-88d8-f5af5cad476f"
Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2"
ProgressLogging = "33c8b6b6-d38a-422a-b730-caa89a2f386c"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand All @@ -34,6 +35,7 @@ MLUtils = "0.2"
MacroTools = "0.5"
NNlib = "0.8.9"
NNlibCUDA = "0.2.4"
OneHotArrays = "0.1"
Optimisers = "0.2.1"
ProgressLogging = "0.1"
Reexport = "0.2, 1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/Flux.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export Descent, Adam, Momentum, Nesterov, RMSProp,
using CUDA
const use_cuda = Ref{Union{Nothing,Bool}}(nothing)

using Adapt, Functors, OneHotArrays
include("utils.jl")
include("onehot.jl")
include("functor.jl")

# Pirate error to catch a common mistake.
Expand Down
290 changes: 0 additions & 290 deletions src/onehot.jl

This file was deleted.

2 changes: 2 additions & 0 deletions test/cuda/cuda.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ end
# construct from CuArray
x = [1, 3, 2]
y = Flux.onehotbatch(x, 0:3)
@test_skip begin # https://github.com/FluxML/OneHotArrays.jl/issues/16
y2 = Flux.onehotbatch(x |> gpu, 0:3)
@test y2.indices isa CuArray
@test y2 |> cpu == y
end
end

@testset "onecold gpu" begin
Expand Down
Loading

0 comments on commit 08d655d

Please sign in to comment.