diff --git a/NDTensors/src/lib/UnallocatedArrays/test/runtests.jl b/NDTensors/src/lib/UnallocatedArrays/test/runtests.jl index ba119b40a6..b7b7fe2839 100644 --- a/NDTensors/src/lib/UnallocatedArrays/test/runtests.jl +++ b/NDTensors/src/lib/UnallocatedArrays/test/runtests.jl @@ -14,7 +14,6 @@ using .NDTensorsTestUtils: devices_list @testset "Basic funcitonality" begin z = Zeros{elt}((2, 3)) Z = UnallocatedZeros(z, dev(Matrix{elt})) - Z = UnallocatedZeros{elt}(z, dev(Matrix{elt})) @test Z isa AbstractFill @test size(Z) == (2, 3) @@ -23,6 +22,8 @@ using .NDTensorsTestUtils: devices_list @test iszero(norm(Z)) @test iszero(Z[2, 3]) @test allocate(Z) isa dev(Matrix{elt}) + Zp = UnallocatedZeros{elt}(Zeros(2, 3), dev(Matrix{elt})) + @test Zp == Z Zp = set_alloctype(z, dev(Matrix{elt})) @test Zp == Z Zc = copy(Z) @@ -45,7 +46,6 @@ using .NDTensorsTestUtils: devices_list # UnallocatedFill f = Fill{elt}(3, (2, 3, 4)) F = UnallocatedFill(f, Array{elt,ndims(f)}) - F = UnallocatedFill{elt}(f, Array{elt,ndims(f)}) @test F isa AbstractFill @test size(F) == (2, 3, 4) @@ -54,6 +54,8 @@ using .NDTensorsTestUtils: devices_list @test norm(F) ≈ sqrt(elt(3)^2 * 24) @test F[2, 3, 1] == elt(3) @test allocate(F) isa Array{elt,3} + Fp = UnallocatedFill{elt}(Fill(3, (2, 3, 4)), Array{elt,ndims(f)}) + @test Fp == F Fp = allocate(F) @test norm(Fp) ≈ norm(F) Fs = similar(F)