Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
test: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 3, 2024
1 parent db85df1 commit f29091b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions test/misc_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ using ChainRulesTestUtils: test_rrule
using ReverseDiff, Tracker, ForwardDiff
using SparseArrays, FillArrays, Zygote, RecursiveArrayTools

@testset "https://github.com/LuxDL/MLDataDevices.jl/issues/10 patch" begin
dev = CPUDevice()
ps = (; weight=randn(10, 1), bias=randn(1))
@testset "Issues Patches" begin
@testset "#10 patch" begin
dev = CPUDevice()
ps = (; weight=randn(10, 1), bias=randn(1))

ps_ca = ps |> ComponentArray
ps_ca = ps |> ComponentArray

ps_ca_dev = ps_ca |> dev
ps_ca_dev = ps_ca |> dev

@test ps_ca_dev isa ComponentArray
@test ps_ca_dev isa ComponentArray

@test ps_ca_dev.weight == ps.weight
@test ps_ca_dev.bias == ps.bias
@test ps_ca_dev.weight == ps.weight
@test ps_ca_dev.bias == ps.bias

@test ps_ca_dev == (ps |> dev |> ComponentArray)
@test ps_ca_dev == (ps |> dev |> ComponentArray)
end
end

@testset "AD Types" begin
Expand Down

0 comments on commit f29091b

Please sign in to comment.