Skip to content

Commit e40e405

Browse files
committed
more strict with provided data
1 parent 9254b50 commit e40e405

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tensors/tensor.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ TensorMap{T}(data::DenseVector{T}, codomain::TensorSpace, domain::TensorSpace) w
138138
139139
Construct a `TensorMap` from the given raw data.
140140
"""
141-
function TensorMapWithStorage{T, A}(data::DenseVector{T}, V::TensorMapSpace) where {T, A}
141+
function TensorMapWithStorage{T, A}(data::A, V::TensorMapSpace) where {T, A}
142142
length(data) == dim(V) || throw(DimensionMismatch("invalid length of data"))
143143
return TensorMap{T, spacetype(V), numout(V), numin(V), A}(data, V)
144144
end
145-
TensorMapWithStorage{T, A}(data::DenseVector{T}, codomain::TensorSpace, domain::TensorSpace) where {T, A} =
145+
TensorMapWithStorage{T, A}(data::A, codomain::TensorSpace, domain::TensorSpace) where {T, A} =
146146
TensorMapWithStorage{T, A}(data, codomain domain)
147147

148148
# AbstractArray constructors

0 commit comments

Comments
 (0)