Skip to content

Commit 129ab75

Browse files
committed
Added test
1 parent 99a76e1 commit 129ab75

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

NDTensors/test/test_dense.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ NDTensors.dim(i::MyInd) = i.dim
3838

3939
Aview = A[2:3, 2:3]
4040
@test dims(Aview) == (2, 2)
41+
## Added for issue 1431 create a tensor from
42+
## a sliced view of another tensor
43+
Acopy = Tensor(NDTensors.storage(Aview), (1,4))
44+
@test @allowscalar data(Acopy) == data(Aview)
45+
@test dims(Acopy) == (1,4)
4146

4247
B = dev(Tensor(elt, undef, (3, 4)))
4348
randn!(B)

0 commit comments

Comments
 (0)