We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1cbc7ed commit bc4ec1aCopy full SHA for bc4ec1a
1 file changed
test/cuda/tensors.jl
@@ -115,6 +115,18 @@ for V in spacelist
115
@test domain(t2) == one(W)
116
end
117
118
+ @timedtestset "Adapt" begin
119
+ W = V1 ⊗ V2 ⊗ V3 ⊗ V4 ⊗ V5
120
+ t = rand(Float64, W)
121
+ t_gpu = @constinferred adapt(CuArray, t)
122
+ @test storagetype(t_gpu) <: CuArray
123
+ @test scalartype(t_gpu) === scalartype(t)
124
+ @test collect(t_gpu.data) == t.data
125
+
126
+ t_cpu = @constinferred adapt(Array, t_cpu)
127
+ @test t_cpu == t
128
+ @test storagetype(t_cpu) isa Array
129
+ end
130
@timedtestset "Tensor Dict conversion" begin
131
W = V1 ⊗ V2 ⊗ V3 ← V4 ⊗ V5
132
for T in (Int, Float32, ComplexF64)
0 commit comments