Skip to content

Commit 99a76e1

Browse files
committed
Create a neveralias tensor function to catch slice issue
1 parent e02b8b3 commit 99a76e1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

NDTensors/src/tensor/tensor.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ function Tensor(as::AliasStyle, storage::TensorStorage, inds::Tuple)
6969
)
7070
end
7171

72+
function Tensor(as::NeverAlias, storage::TensorStorage, inds::Tuple)
73+
return Tensor(AllowAlias(), copy(storage), inds)
74+
end
75+
7276
# Automatically convert to Tuple if the indices are not a Tuple
7377
# already (like a Vector). In the future this may be lifted
7478
# to allow for very large tensor orders in which case Tuple

0 commit comments

Comments
 (0)