Skip to content

Commit 6484a11

Browse files
committed
Remove NDTensors as test dep
1 parent e38dc08 commit 6484a11

File tree

6 files changed

+10
-87
lines changed

6 files changed

+10
-87
lines changed

TODO.md

Lines changed: 0 additions & 68 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
[deps]
22
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
3-
NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf"
43
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
[deps]
22
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
3-
NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf"
43
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/abstractblocksparsearray/abstractblocksparsearray.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
using BlockArrays:
22
BlockArrays, AbstractBlockArray, Block, BlockIndex, BlockedUnitRange, blocks
33

4-
# TODO: Delete this. This function was replaced
5-
# by `stored_length` but is still used in `NDTensors`.
6-
function nonzero_keys end
7-
84
abstract type AbstractBlockSparseArray{T,N} <: AbstractBlockArray{T,N} end
95

106
## Base `AbstractArray` interface

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[deps]
2+
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
23
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
34
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
45
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
@@ -10,7 +11,6 @@ GradedUnitRanges = "e2de450a-8a67-46c7-b59c-01d5a3d041c5"
1011
JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb"
1112
LabelledNumbers = "f856a3a6-4152-4ec4-b2a7-02c1a55d7993"
1213
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
13-
NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf"
1414
NestedPermutedDimsArrays = "2c2a8ec4-3cfc-4276-aa3e-1307b4294e58"
1515
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1616
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

test/basics/test_basics.jl

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Adapt: adapt
12
using ArrayLayouts: zero!
23
using BlockArrays:
34
Block,
@@ -28,22 +29,18 @@ using BlockSparseArrays:
2829
blocktype,
2930
view!
3031
using GPUArraysCore: @allowscalar
32+
using JLArrays: JLArray
3133
using LinearAlgebra: Adjoint, Transpose, dot, mul!, norm
32-
using NDTensors.GPUArraysCoreExtensions: cpu
3334
using SparseArraysBase: SparseArrayDOK, SparseMatrixDOK, SparseVectorDOK, storedlength
3435
using TensorAlgebra: contract
3536
using Test: @test, @test_broken, @test_throws, @testset, @inferred
3637
include("TestBlockSparseArraysUtils.jl")
3738

38-
using NDTensors: NDTensors
39-
include(joinpath(pkgdir(NDTensors), "test", "NDTensorsTestUtils", "NDTensorsTestUtils.jl"))
40-
using .NDTensorsTestUtils: devices_list, is_supported_eltype
41-
@testset "BlockSparseArrays (dev=$dev, eltype=$elt)" for dev in devices_list(copy(ARGS)),
39+
arrayts = (Array, JLArray)
40+
@testset "BlockSparseArrays (arraytype=$arrayt, eltype=$elt)" for arrayt in arrayts,
4241
elt in (Float32, Float64, Complex{Float32}, Complex{Float64})
4342

44-
if !is_supported_eltype(dev, elt)
45-
continue
46-
end
43+
dev(a) = adapt(arrayt, a)
4744
@testset "Broken" begin
4845
# TODO: Fix this and turn it into a proper test.
4946
a = dev(BlockSparseArray{elt}([2, 3], [2, 3]))
@@ -268,7 +265,7 @@ using .NDTensorsTestUtils: devices_list, is_supported_eltype
268265
@test storedlength(a) == 2 * 4 + 3 * 3
269266

270267
# TODO: Broken on GPU.
271-
if dev cpu
268+
if arrayt Array
272269
a = dev(BlockSparseArray{elt}([2, 3], [3, 4]))
273270
@test_broken a[Block(1, 2)] .= 2
274271
end
@@ -285,7 +282,7 @@ using .NDTensorsTestUtils: devices_list, is_supported_eltype
285282
@test storedlength(a) == 2 * 4
286283

287284
# TODO: Broken on GPU.
288-
if dev cpu
285+
if arrayt Array
289286
a = dev(BlockSparseArray{elt}([2, 3], [3, 4]))
290287
@test_broken a[Block(1, 2)] .= 0
291288
end
@@ -321,15 +318,15 @@ using .NDTensorsTestUtils: devices_list, is_supported_eltype
321318
@test iszero(b)
322319
@test iszero(storedlength(b))
323320
# TODO: Broken on GPU.
324-
@test iszero(c) broken = dev cpu
321+
@test iszero(c) broken = arrayt Array
325322
@test iszero(storedlength(c))
326323
@allowscalar a[5, 7] = 1
327324
@test !iszero(a)
328325
@test storedlength(a) == 3 * 4
329326
@test !iszero(b)
330327
@test storedlength(b) == 3 * 4
331328
# TODO: Broken on GPU.
332-
@test !iszero(c) broken = dev cpu
329+
@test !iszero(c) broken = arrayt Array
333330
@test storedlength(c) == 3 * 4
334331
d = @view a[1:4, 1:6]
335332
@test iszero(d)

0 commit comments

Comments
 (0)